diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/CHANGELOG.md b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/CHANGELOG.md index f2e0cab9056e5..175221c681d83 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/CHANGELOG.md +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/CHANGELOG.md @@ -1,7 +1,8 @@ # Release History -## 1.0.0-beta.2 (Unreleased) +## 1.0.0-beta.1 (2022-06-14) +- Azure Resource Manager Deployment client library for Java. This package contains Microsoft Azure SDK for Deployment Management SDK. REST APIs for orchestrating deployments using the Azure Deployment Manager (ADM). See https://docs.microsoft.com/en-us/azure/azure-resource-manager/deployment-manager-overview for more information. Package tag package-2019-11-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## 1.0.0-beta.1 (2021-04-20) diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/README.md b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/README.md index c0fb3888e4bbf..baaa80434f5ae 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/README.md +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/README.md @@ -2,7 +2,7 @@ Azure Resource Manager Deployment client library for Java. -This package contains Microsoft Azure SDK for Deployment Management SDK. REST APIs for orchestrating deployments using the Azure Deployment Manager (ADM). See https://docs.microsoft.com/azure/azure-resource-manager/deployment-manager-overview for more information. Package tag package-2019-11-01-preview. 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 Deployment Management SDK. REST APIs for orchestrating deployments using the Azure Deployment Manager (ADM). See https://docs.microsoft.com/en-us/azure/azure-resource-manager/deployment-manager-overview for more information. Package tag package-2019-11-01-preview. 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-deploymentmanager - 1.0.0-beta.1 + 1.0.0-beta.2 ``` [//]: # ({x-version-update-end}) @@ -74,6 +74,9 @@ See [API design][design] for general introduction on design and key concepts on ## Examples +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/SAMPLE.md) + + ## Troubleshooting ## Next steps diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/SAMPLE.md b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/SAMPLE.md new file mode 100644 index 0000000000000..072bfa16ebe7d --- /dev/null +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/SAMPLE.md @@ -0,0 +1,933 @@ +# Code snippets and samples + + +## ArtifactSources + +- [CreateOrUpdate](#artifactsources_createorupdate) +- [Delete](#artifactsources_delete) +- [GetByResourceGroup](#artifactsources_getbyresourcegroup) +- [List](#artifactsources_list) + +## Operations + +- [List](#operations_list) + +## Rollouts + +- [Cancel](#rollouts_cancel) +- [CreateOrUpdate](#rollouts_createorupdate) +- [Delete](#rollouts_delete) +- [GetByResourceGroup](#rollouts_getbyresourcegroup) +- [List](#rollouts_list) +- [Restart](#rollouts_restart) + +## ServiceTopologies + +- [CreateOrUpdate](#servicetopologies_createorupdate) +- [Delete](#servicetopologies_delete) +- [GetByResourceGroup](#servicetopologies_getbyresourcegroup) +- [List](#servicetopologies_list) + +## ServiceUnits + +- [CreateOrUpdate](#serviceunits_createorupdate) +- [Delete](#serviceunits_delete) +- [Get](#serviceunits_get) +- [List](#serviceunits_list) + +## Services + +- [CreateOrUpdate](#services_createorupdate) +- [Delete](#services_delete) +- [Get](#services_get) +- [List](#services_list) + +## Steps + +- [CreateOrUpdate](#steps_createorupdate) +- [Delete](#steps_delete) +- [GetByResourceGroup](#steps_getbyresourcegroup) +- [List](#steps_list) +### ArtifactSources_CreateOrUpdate + +```java +import java.util.HashMap; +import java.util.Map; + +/** Samples for ArtifactSources CreateOrUpdate. */ +public final class ArtifactSourcesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/artifactsource_createorupdate.json + */ + /** + * Sample code: Create artifact source. + * + * @param manager Entry point to DeploymentManager. + */ + public static void createArtifactSource(com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager + .artifactSources() + .define("myArtifactSource") + .withRegion("centralus") + .withExistingResourceGroup("myResourceGroup") + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/artifactsource_createorupdate_artifactroot.json + */ + /** + * Sample code: Create artifact source with artifact root, an offset into the storage container. + * + * @param manager Entry point to DeploymentManager. + */ + public static void createArtifactSourceWithArtifactRootAnOffsetIntoTheStorageContainer( + com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager + .artifactSources() + .define("myArtifactSource") + .withRegion("centralus") + .withExistingResourceGroup("myResourceGroup") + .withTags(mapOf()) + .create(); + } + + @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; + } +} +``` + +### ArtifactSources_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for ArtifactSources Delete. */ +public final class ArtifactSourcesDeleteSamples { + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/artifactsource_delete.json + */ + /** + * Sample code: Delete artifact source. + * + * @param manager Entry point to DeploymentManager. + */ + public static void deleteArtifactSource(com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager.artifactSources().deleteWithResponse("myResourceGroup", "myArtifactSource", Context.NONE); + } +} +``` + +### ArtifactSources_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for ArtifactSources GetByResourceGroup. */ +public final class ArtifactSourcesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/artifactsource_get.json + */ + /** + * Sample code: Get artifact source. + * + * @param manager Entry point to DeploymentManager. + */ + public static void getArtifactSource(com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager.artifactSources().getByResourceGroupWithResponse("myResourceGroup", "myArtifactSource", Context.NONE); + } +} +``` + +### ArtifactSources_List + +```java +import com.azure.core.util.Context; + +/** Samples for ArtifactSources List. */ +public final class ArtifactSourcesListSamples { + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/artifactsources_list.json + */ + /** + * Sample code: List steps. + * + * @param manager Entry point to DeploymentManager. + */ + public static void listSteps(com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager.artifactSources().listWithResponse("myResourceGroup", Context.NONE); + } +} +``` + +### Operations_List + +```java +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/operations_list.json + */ + /** + * Sample code: Get operations. + * + * @param manager Entry point to DeploymentManager. + */ + public static void getOperations(com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager.operations().listWithResponse(Context.NONE); + } +} +``` + +### Rollouts_Cancel + +```java +import com.azure.core.util.Context; + +/** Samples for Rollouts Cancel. */ +public final class RolloutsCancelSamples { + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/rollout_post_cancel.json + */ + /** + * Sample code: Cancel rollout. + * + * @param manager Entry point to DeploymentManager. + */ + public static void cancelRollout(com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager.rollouts().cancelWithResponse("myResourceGroup", "myRollout", Context.NONE); + } +} +``` + +### Rollouts_CreateOrUpdate + +```java +import com.azure.resourcemanager.deploymentmanager.models.Identity; +import com.azure.resourcemanager.deploymentmanager.models.PrePostStep; +import com.azure.resourcemanager.deploymentmanager.models.StepGroup; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Rollouts CreateOrUpdate. */ +public final class RolloutsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/rollout_createorupdate.json + */ + /** + * Sample code: Create or update rollout. + * + * @param manager Entry point to DeploymentManager. + */ + public static void createOrUpdateRollout(com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager + .rollouts() + .define("myRollout") + .withRegion("centralus") + .withExistingResourceGroup("myResourceGroup") + .withIdentity( + new Identity() + .withType("userAssigned") + .withIdentityIds( + Arrays + .asList( + "/subscriptions/caac1590-e859-444f-a9e0-62091c0f5929/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userassignedidentities/myuseridentity"))) + .withBuildVersion("1.0.0.1") + .withTargetServiceTopologyId( + "/subscriptions/caac1590-e859-444f-a9e0-62091c0f5929/resourceGroups/myResourceGroup/Microsoft.DeploymentManager/serviceTopologies/myTopology") + .withStepGroups( + Arrays + .asList( + new StepGroup() + .withName("FirstRegion") + .withPreDeploymentSteps( + Arrays + .asList( + new PrePostStep() + .withStepId("Microsoft.DeploymentManager/steps/preDeployStep1"), + new PrePostStep() + .withStepId("Microsoft.DeploymentManager/steps/preDeployStep2"))) + .withDeploymentTargetId( + "Microsoft.DeploymentManager/serviceTopologies/myTopology/services/myService/serviceUnits/myServiceUnit1'") + .withPostDeploymentSteps( + Arrays + .asList( + new PrePostStep() + .withStepId("Microsoft.DeploymentManager/steps/postDeployStep1"))), + new StepGroup() + .withName("SecondRegion") + .withDependsOnStepGroups(Arrays.asList("FirstRegion")) + .withPreDeploymentSteps( + Arrays + .asList( + new PrePostStep() + .withStepId("Microsoft.DeploymentManager/steps/preDeployStep3"), + new PrePostStep() + .withStepId("Microsoft.DeploymentManager/steps/preDeployStep4"))) + .withDeploymentTargetId( + "Microsoft.DeploymentManager/serviceTopologies/myTopology/services/myService/serviceUnits/myServiceUnit2'") + .withPostDeploymentSteps( + Arrays + .asList( + new PrePostStep() + .withStepId("Microsoft.DeploymentManager/steps/postDeployStep5"))))) + .withTags(mapOf()) + .withArtifactSourceId( + "/subscriptions/caac1590-e859-444f-a9e0-62091c0f5929/resourceGroups/myResourceGroup/Microsoft.DeploymentManager/artifactSources/myArtifactSource") + .create(); + } + + @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; + } +} +``` + +### Rollouts_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Rollouts Delete. */ +public final class RolloutsDeleteSamples { + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/rollout_delete.json + */ + /** + * Sample code: Delete rollout. + * + * @param manager Entry point to DeploymentManager. + */ + public static void deleteRollout(com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager.rollouts().deleteWithResponse("myResourceGroup", "myRollout", Context.NONE); + } +} +``` + +### Rollouts_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Rollouts GetByResourceGroup. */ +public final class RolloutsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/rollout_get.json + */ + /** + * Sample code: Get rollout. + * + * @param manager Entry point to DeploymentManager. + */ + public static void getRollout(com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager.rollouts().getByResourceGroupWithResponse("myResourceGroup", "myRollout", null, Context.NONE); + } +} +``` + +### Rollouts_List + +```java +import com.azure.core.util.Context; + +/** Samples for Rollouts List. */ +public final class RolloutsListSamples { + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/rollouts_list.json + */ + /** + * Sample code: List rollouts by resource group. + * + * @param manager Entry point to DeploymentManager. + */ + public static void listRolloutsByResourceGroup( + com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager.rollouts().listWithResponse("myResourceGroup", Context.NONE); + } +} +``` + +### Rollouts_Restart + +```java +import com.azure.core.util.Context; + +/** Samples for Rollouts Restart. */ +public final class RolloutsRestartSamples { + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/rollout_post_restart.json + */ + /** + * Sample code: Restart rollout. + * + * @param manager Entry point to DeploymentManager. + */ + public static void restartRollout(com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager.rollouts().restartWithResponse("myResourceGroup", "myRollout", true, Context.NONE); + } +} +``` + +### ServiceTopologies_CreateOrUpdate + +```java +import java.util.HashMap; +import java.util.Map; + +/** Samples for ServiceTopologies CreateOrUpdate. */ +public final class ServiceTopologiesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/servicetopology_createorupdate.json + */ + /** + * Sample code: Create a topology with Artifact Source. + * + * @param manager Entry point to DeploymentManager. + */ + public static void createATopologyWithArtifactSource( + com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager + .serviceTopologies() + .define("myTopology") + .withRegion("centralus") + .withExistingResourceGroup("myResourceGroup") + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/servicetopology_createorupdate_noartifactsource.json + */ + /** + * Sample code: Create a topology without Artifact Source. + * + * @param manager Entry point to DeploymentManager. + */ + public static void createATopologyWithoutArtifactSource( + com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager + .serviceTopologies() + .define("myTopology") + .withRegion("centralus") + .withExistingResourceGroup("myResourceGroup") + .withTags(mapOf()) + .create(); + } + + @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; + } +} +``` + +### ServiceTopologies_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for ServiceTopologies Delete. */ +public final class ServiceTopologiesDeleteSamples { + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/servicetopology_delete.json + */ + /** + * Sample code: Delete topology. + * + * @param manager Entry point to DeploymentManager. + */ + public static void deleteTopology(com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager.serviceTopologies().deleteWithResponse("myResourceGroup", "myTopology", Context.NONE); + } +} +``` + +### ServiceTopologies_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for ServiceTopologies GetByResourceGroup. */ +public final class ServiceTopologiesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/servicetopology_get.json + */ + /** + * Sample code: Get topology. + * + * @param manager Entry point to DeploymentManager. + */ + public static void getTopology(com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager.serviceTopologies().getByResourceGroupWithResponse("myResourceGroup", "myTopology", Context.NONE); + } +} +``` + +### ServiceTopologies_List + +```java +import com.azure.core.util.Context; + +/** Samples for ServiceTopologies List. */ +public final class ServiceTopologiesListSamples { + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/servicetopologies_list.json + */ + /** + * Sample code: List topologies. + * + * @param manager Entry point to DeploymentManager. + */ + public static void listTopologies(com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager.serviceTopologies().listWithResponse("myResourceGroup", Context.NONE); + } +} +``` + +### ServiceUnits_CreateOrUpdate + +```java +import java.util.HashMap; +import java.util.Map; + +/** Samples for ServiceUnits CreateOrUpdate. */ +public final class ServiceUnitsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/serviceunit_createorupdate.json + */ + /** + * Sample code: Create service unit using relative paths into the artifact source. + * + * @param manager Entry point to DeploymentManager. + */ + public static void createServiceUnitUsingRelativePathsIntoTheArtifactSource( + com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager + .serviceUnits() + .define("myServiceUnit") + .withRegion("centralus") + .withExistingService("myResourceGroup", "myTopology", "myService") + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/serviceunit_createorupdate_noartifactsource.json + */ + /** + * Sample code: Create service unit using SAS URIs. + * + * @param manager Entry point to DeploymentManager. + */ + public static void createServiceUnitUsingSASURIs( + com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager + .serviceUnits() + .define("myServiceUnit") + .withRegion("centralus") + .withExistingService("myResourceGroup", "myTopology", "myService") + .withTags(mapOf()) + .create(); + } + + @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; + } +} +``` + +### ServiceUnits_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for ServiceUnits Delete. */ +public final class ServiceUnitsDeleteSamples { + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/serviceunit_delete.json + */ + /** + * Sample code: Delete service unit. + * + * @param manager Entry point to DeploymentManager. + */ + public static void deleteServiceUnit(com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager + .serviceUnits() + .deleteWithResponse("myResourceGroup", "myTopology", "myService", "myServiceUnit", Context.NONE); + } +} +``` + +### ServiceUnits_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ServiceUnits Get. */ +public final class ServiceUnitsGetSamples { + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/serviceunit_get.json + */ + /** + * Sample code: Get service unit. + * + * @param manager Entry point to DeploymentManager. + */ + public static void getServiceUnit(com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager + .serviceUnits() + .getWithResponse("myResourceGroup", "myTopology", "myService", "myServiceUnit", Context.NONE); + } +} +``` + +### ServiceUnits_List + +```java +import com.azure.core.util.Context; + +/** Samples for ServiceUnits List. */ +public final class ServiceUnitsListSamples { + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/serviceunits_list.json + */ + /** + * Sample code: List service units. + * + * @param manager Entry point to DeploymentManager. + */ + public static void listServiceUnits(com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager.serviceUnits().listWithResponse("myResourceGroup", "myTopology", "myService", Context.NONE); + } +} +``` + +### Services_CreateOrUpdate + +```java +import java.util.HashMap; +import java.util.Map; + +/** Samples for Services CreateOrUpdate. */ +public final class ServicesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/service_createorupdate.json + */ + /** + * Sample code: Create service. + * + * @param manager Entry point to DeploymentManager. + */ + public static void createService(com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager + .services() + .define("myService") + .withRegion("centralus") + .withExistingServiceTopology("myResourceGroup", "myTopology") + .withTags(mapOf()) + .create(); + } + + @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; + } +} +``` + +### Services_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Services Delete. */ +public final class ServicesDeleteSamples { + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/service_delete.json + */ + /** + * Sample code: Delete service. + * + * @param manager Entry point to DeploymentManager. + */ + public static void deleteService(com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager.services().deleteWithResponse("myResourceGroup", "myTopology", "myService", Context.NONE); + } +} +``` + +### Services_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Services Get. */ +public final class ServicesGetSamples { + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/service_get.json + */ + /** + * Sample code: Get service. + * + * @param manager Entry point to DeploymentManager. + */ + public static void getService(com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager.services().getWithResponse("myResourceGroup", "myTopology", "myService", Context.NONE); + } +} +``` + +### Services_List + +```java +import com.azure.core.util.Context; + +/** Samples for Services List. */ +public final class ServicesListSamples { + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/services_list.json + */ + /** + * Sample code: List services. + * + * @param manager Entry point to DeploymentManager. + */ + public static void listServices(com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager.services().listWithResponse("myResourceGroup", "myTopology", Context.NONE); + } +} +``` + +### Steps_CreateOrUpdate + +```java +import com.azure.resourcemanager.deploymentmanager.models.ApiKeyAuthentication; +import com.azure.resourcemanager.deploymentmanager.models.HealthCheckStepProperties; +import com.azure.resourcemanager.deploymentmanager.models.RestAuthLocation; +import com.azure.resourcemanager.deploymentmanager.models.RestHealthCheck; +import com.azure.resourcemanager.deploymentmanager.models.RestHealthCheckStepAttributes; +import com.azure.resourcemanager.deploymentmanager.models.RestMatchQuantifier; +import com.azure.resourcemanager.deploymentmanager.models.RestRequest; +import com.azure.resourcemanager.deploymentmanager.models.RestRequestMethod; +import com.azure.resourcemanager.deploymentmanager.models.RestResponse; +import com.azure.resourcemanager.deploymentmanager.models.RestResponseRegex; +import com.azure.resourcemanager.deploymentmanager.models.WaitStepAttributes; +import com.azure.resourcemanager.deploymentmanager.models.WaitStepProperties; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Steps CreateOrUpdate. */ +public final class StepsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/step_health_check_createorupdate.json + */ + /** + * Sample code: Create health check step. + * + * @param manager Entry point to DeploymentManager. + */ + public static void createHealthCheckStep(com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager + .steps() + .define("healthCheckStep") + .withRegion("centralus") + .withExistingResourceGroup("myResourceGroup") + .withProperties( + new HealthCheckStepProperties() + .withAttributes( + new RestHealthCheckStepAttributes() + .withWaitDuration("PT15M") + .withMaxElasticDuration("PT30M") + .withHealthyStateDuration("PT2H") + .withHealthChecks( + Arrays + .asList( + new RestHealthCheck() + .withName("appHealth") + .withRequest( + new RestRequest() + .withMethod(RestRequestMethod.GET) + .withUri( + "https://resthealth.healthservice.com/api/applications/contosoApp/healthStatus") + .withAuthentication( + new ApiKeyAuthentication() + .withName("Code") + .withIn(RestAuthLocation.QUERY) + .withValue( + "NBCapiMOBQyAAbCkeytoPadnvO0eGHmidwFz5rXpappznKp3Jt7LLg=="))) + .withResponse( + new RestResponse() + .withSuccessStatusCodes(Arrays.asList("OK")) + .withRegex( + new RestResponseRegex() + .withMatches( + Arrays + .asList( + "(?i)Contoso-App", + "(?i)\"health_status\":((.|\n" + + ")*)\"(green|yellow)\"", + "(?mi)^(\"application_host\": 94781052)$")) + .withMatchQuantifier(RestMatchQuantifier.ALL))), + new RestHealthCheck() + .withName("serviceHealth") + .withRequest( + new RestRequest() + .withMethod(RestRequestMethod.GET) + .withUri( + "https://resthealth.healthservice.com/api/services/contosoService/healthStatus") + .withAuthentication( + new ApiKeyAuthentication() + .withName("code") + .withIn(RestAuthLocation.HEADER) + .withValue( + "NBCapiMOBQyAAbCkeytoPadnvO0eGHmidwFz5rXpappznKp3Jt7LLg=="))) + .withResponse( + new RestResponse() + .withSuccessStatusCodes(Arrays.asList("OK")) + .withRegex( + new RestResponseRegex() + .withMatches( + Arrays + .asList( + "(?i)Contoso-Service-EndToEnd", + "(?i)\"health_status\":((.|\n)*)\"(green)\"")) + .withMatchQuantifier(RestMatchQuantifier.ALL))))))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/step_wait_createorupdate.json + */ + /** + * Sample code: Create wait step. + * + * @param manager Entry point to DeploymentManager. + */ + public static void createWaitStep(com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager + .steps() + .define("waitStep") + .withRegion("centralus") + .withExistingResourceGroup("myResourceGroup") + .withProperties(new WaitStepProperties().withAttributes(new WaitStepAttributes().withDuration("PT20M"))) + .withTags(mapOf()) + .create(); + } + + @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; + } +} +``` + +### Steps_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Steps Delete. */ +public final class StepsDeleteSamples { + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/step_delete.json + */ + /** + * Sample code: Delete deployment step. + * + * @param manager Entry point to DeploymentManager. + */ + public static void deleteDeploymentStep(com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager.steps().deleteWithResponse("myResourceGroup", "deploymentStep1", Context.NONE); + } +} +``` + +### Steps_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Steps GetByResourceGroup. */ +public final class StepsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/step_get.json + */ + /** + * Sample code: Get deployment step. + * + * @param manager Entry point to DeploymentManager. + */ + public static void getDeploymentStep(com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager.steps().getByResourceGroupWithResponse("myResourceGroup", "waitStep", Context.NONE); + } +} +``` + +### Steps_List + +```java +import com.azure.core.util.Context; + +/** Samples for Steps List. */ +public final class StepsListSamples { + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/steps_list.json + */ + /** + * Sample code: List steps. + * + * @param manager Entry point to DeploymentManager. + */ + public static void listSteps(com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager.steps().listWithResponse("myResourceGroup", Context.NONE); + } +} +``` + diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/pom.xml b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/pom.xml index 94f8cec0dbcb1..7ac0d5d9e12f1 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/pom.xml +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/pom.xml @@ -1,55 +1,55 @@ - 4.0.0 - - com.azure - azure-client-sdk-parent - 1.7.0 - ../../parents/azure-client-sdk-parent - + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + - com.azure.resourcemanager - azure-resourcemanager-deploymentmanager - 1.0.0-beta.2 - jar + com.azure.resourcemanager + azure-resourcemanager-deploymentmanager + 1.0.0-beta.2 + jar - Microsoft Azure SDK for Deployment Management - This package contains Microsoft Azure SDK for Deployment Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. REST APIs for orchestrating deployments using the Azure Deployment Manager (ADM). See https://docs.microsoft.com/azure/azure-resource-manager/deployment-manager-overview for more information. Package tag package-2019-11-01-preview. - https://github.com/Azure/azure-sdk-for-java + Microsoft Azure SDK for Deployment Management + This package contains Microsoft Azure SDK for Deployment Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. REST APIs for orchestrating deployments using the Azure Deployment Manager (ADM). See https://docs.microsoft.com/en-us/azure/azure-resource-manager/deployment-manager-overview for more information. Package tag package-2019-11-01-preview. + https://github.com/Azure/azure-sdk-for-java - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + - - https://github.com/Azure/azure-sdk-for-java - scm:git:git@github.com:Azure/azure-sdk-for-java.git - scm:git:git@github.com:Azure/azure-sdk-for-java.git - HEAD - - - - microsoft - Microsoft - - - - UTF-8 - true - - - - com.azure - azure-core - 1.29.1 - - - com.azure - azure-core-management - 1.6.2 - - + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + true + + + + com.azure + azure-core + 1.29.1 + + + com.azure + azure-core-management + 1.6.2 + + diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/DeploymentManager.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/DeploymentManager.java index f0117a01b7975..32babc3ddb8bd 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/DeploymentManager.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/DeploymentManager.java @@ -8,15 +8,18 @@ import com.azure.core.http.HttpClient; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; import com.azure.core.http.policy.HttpPipelinePolicy; import com.azure.core.http.policy.HttpPolicyProviders; import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; @@ -41,10 +44,11 @@ import java.util.ArrayList; import java.util.List; import java.util.Objects; +import java.util.stream.Collectors; /** * Entry point to DeploymentManager. REST APIs for orchestrating deployments using the Azure Deployment Manager (ADM). - * See https://docs.microsoft.com/azure/azure-resource-manager/deployment-manager-overview for more information. + * See https://docs.microsoft.com/en-us/azure/azure-resource-manager/deployment-manager-overview for more information. */ public final class DeploymentManager { private ServiceTopologies serviceTopologies; @@ -88,6 +92,19 @@ public static DeploymentManager authenticate(TokenCredential credential, AzurePr return configure().authenticate(credential, profile); } + /** + * Creates an instance of Deployment service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the Deployment service API instance. + */ + public static DeploymentManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new DeploymentManager(httpPipeline, profile, null); + } + /** * Gets a Configurable instance that can be used to create DeploymentManager with optional configuration. * @@ -99,12 +116,14 @@ public static Configurable configure() { /** The Configurable allowing configurations to be set. */ public static final class Configurable { - private final ClientLogger logger = new ClientLogger(Configurable.class); + private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); private HttpClient httpClient; private HttpLogOptions httpLogOptions; private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); private RetryPolicy retryPolicy; + private RetryOptions retryOptions; private Duration defaultPollInterval; private Configurable() { @@ -143,6 +162,17 @@ public Configurable withPolicy(HttpPipelinePolicy policy) { return this; } + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + /** * Sets the retry policy to the HTTP pipeline. * @@ -154,6 +184,19 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) { return this; } + /** + * Sets the retry options for the HTTP pipeline retry policy. + * + *

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. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null."); + return this; + } + /** * Sets the default poll interval, used when service does not provide "Retry-After" header. * @@ -161,9 +204,11 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) { * @return the configurable object itself. */ public Configurable withDefaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null."); + this.defaultPollInterval = + Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); if (this.defaultPollInterval.isNegative()) { - throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative")); + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); } return this; } @@ -199,20 +244,38 @@ public DeploymentManager authenticate(TokenCredential credential, AzureProfile p userAgentBuilder.append(" (auto-generated)"); } + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } if (retryPolicy == null) { - retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } } List policies = new ArrayList<>(); 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())); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); policies - .add( - new BearerTokenAuthenticationPolicy( - credential, profile.getEnvironment().getManagementEndpoint() + "/.default")); - policies.addAll(this.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 = @@ -224,7 +287,11 @@ public DeploymentManager authenticate(TokenCredential credential, AzureProfile p } } - /** @return Resource collection API of ServiceTopologies. */ + /** + * Gets the resource collection API of ServiceTopologies. It manages ServiceTopologyResource. + * + * @return Resource collection API of ServiceTopologies. + */ public ServiceTopologies serviceTopologies() { if (this.serviceTopologies == null) { this.serviceTopologies = new ServiceTopologiesImpl(clientObject.getServiceTopologies(), this); @@ -232,7 +299,11 @@ public ServiceTopologies serviceTopologies() { return serviceTopologies; } - /** @return Resource collection API of Services. */ + /** + * Gets the resource collection API of Services. It manages ServiceResource. + * + * @return Resource collection API of Services. + */ public Services services() { if (this.services == null) { this.services = new ServicesImpl(clientObject.getServices(), this); @@ -240,7 +311,11 @@ public Services services() { return services; } - /** @return Resource collection API of ServiceUnits. */ + /** + * Gets the resource collection API of ServiceUnits. It manages ServiceUnitResource. + * + * @return Resource collection API of ServiceUnits. + */ public ServiceUnits serviceUnits() { if (this.serviceUnits == null) { this.serviceUnits = new ServiceUnitsImpl(clientObject.getServiceUnits(), this); @@ -248,7 +323,11 @@ public ServiceUnits serviceUnits() { return serviceUnits; } - /** @return Resource collection API of Steps. */ + /** + * Gets the resource collection API of Steps. It manages StepResource. + * + * @return Resource collection API of Steps. + */ public Steps steps() { if (this.steps == null) { this.steps = new StepsImpl(clientObject.getSteps(), this); @@ -256,7 +335,11 @@ public Steps steps() { return steps; } - /** @return Resource collection API of Rollouts. */ + /** + * Gets the resource collection API of Rollouts. It manages RolloutRequest. + * + * @return Resource collection API of Rollouts. + */ public Rollouts rollouts() { if (this.rollouts == null) { this.rollouts = new RolloutsImpl(clientObject.getRollouts(), this); @@ -264,7 +347,11 @@ public Rollouts rollouts() { return rollouts; } - /** @return Resource collection API of ArtifactSources. */ + /** + * Gets the resource collection API of ArtifactSources. It manages ArtifactSource. + * + * @return Resource collection API of ArtifactSources. + */ public ArtifactSources artifactSources() { if (this.artifactSources == null) { this.artifactSources = new ArtifactSourcesImpl(clientObject.getArtifactSources(), this); @@ -272,7 +359,11 @@ public ArtifactSources artifactSources() { return artifactSources; } - /** @return Resource collection API of Operations. */ + /** + * Gets the resource collection API of Operations. + * + * @return Resource collection API of Operations. + */ public Operations operations() { if (this.operations == null) { this.operations = new OperationsImpl(clientObject.getOperations(), this); diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/ArtifactSourcesClient.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/ArtifactSourcesClient.java index fffc4183b45e8..9066330db8642 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/ArtifactSourcesClient.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/ArtifactSourcesClient.java @@ -36,7 +36,8 @@ public interface ArtifactSourcesClient { * @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 resource that defines the source location where the artifacts are located. + * @return the resource that defines the source location where the artifacts are located along with {@link + * Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response createOrUpdateWithResponse( @@ -64,7 +65,7 @@ Response createOrUpdateWithResponse( * @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 an artifact source. + * @return an artifact source along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getByResourceGroupWithResponse( @@ -91,7 +92,7 @@ Response getByResourceGroupWithResponse( * @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. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response deleteWithResponse(String resourceGroupName, String artifactSourceName, Context context); @@ -116,7 +117,7 @@ Response getByResourceGroupWithResponse( * @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 list of artifact sources. + * @return the list of artifact sources along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response> listWithResponse(String resourceGroupName, Context context); diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/OperationsClient.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/OperationsClient.java index b7c13ede2daaa..13f4c24ad3a10 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/OperationsClient.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/OperationsClient.java @@ -29,7 +29,7 @@ public interface OperationsClient { * @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 operations response. + * @return the operations response along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response listWithResponse(Context context); diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/RolloutsClient.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/RolloutsClient.java index e1161735dd62c..af5e925154de8 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/RolloutsClient.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/RolloutsClient.java @@ -26,9 +26,9 @@ public interface RolloutsClient { * @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 defines the PUT rollout request body. + * @return the {@link SyncPoller} for polling of defines the PUT rollout request body. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, RolloutRequestInner> beginCreateOrUpdate( String resourceGroupName, String rolloutName, RolloutRequestInner rolloutRequest); @@ -43,9 +43,9 @@ SyncPoller, RolloutRequestInner> beginCreateOrUp * @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 defines the PUT rollout request body. + * @return the {@link SyncPoller} for polling of defines the PUT rollout request body. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, RolloutRequestInner> beginCreateOrUpdate( String resourceGroupName, String rolloutName, RolloutRequestInner rolloutRequest, Context context); @@ -120,7 +120,7 @@ RolloutRequestInner createOrUpdate( * @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 detailed information of a rollout. + * @return detailed information of a rollout along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getByResourceGroupWithResponse( @@ -147,7 +147,7 @@ Response getByResourceGroupWithResponse( * @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. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response deleteWithResponse(String resourceGroupName, String rolloutName, Context context); @@ -174,7 +174,7 @@ Response getByResourceGroupWithResponse( * @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 defines the rollout. + * @return defines the rollout along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response cancelWithResponse(String resourceGroupName, String rolloutName, Context context); @@ -204,7 +204,7 @@ Response getByResourceGroupWithResponse( * @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 defines the rollout. + * @return defines the rollout along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response restartWithResponse( @@ -230,7 +230,7 @@ Response restartWithResponse( * @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 list of rollouts. + * @return the list of rollouts along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response> listWithResponse(String resourceGroupName, Context context); diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/ServiceTopologiesClient.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/ServiceTopologiesClient.java index fb658dd12aa30..e3968b2df2883 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/ServiceTopologiesClient.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/ServiceTopologiesClient.java @@ -38,7 +38,7 @@ ServiceTopologyResourceInner createOrUpdate( * @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 resource representation of a service topology. + * @return the resource representation of a service topology along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response createOrUpdateWithResponse( @@ -69,7 +69,7 @@ Response createOrUpdateWithResponse( * @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 service topology. + * @return the service topology along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getByResourceGroupWithResponse( @@ -96,7 +96,7 @@ Response getByResourceGroupWithResponse( * @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. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response deleteWithResponse(String resourceGroupName, String serviceTopologyName, Context context); @@ -121,7 +121,7 @@ Response getByResourceGroupWithResponse( * @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 list of service topologies. + * @return the list of service topologies along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response> listWithResponse(String resourceGroupName, Context context); diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/ServiceUnitsClient.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/ServiceUnitsClient.java index e18a0cc4ba7d5..1e270b72853d5 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/ServiceUnitsClient.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/ServiceUnitsClient.java @@ -27,9 +27,9 @@ public interface ServiceUnitsClient { * @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 represents the response of a service unit resource. + * @return the {@link SyncPoller} for polling of represents the response of a service unit resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ServiceUnitResourceInner> beginCreateOrUpdate( String resourceGroupName, String serviceTopologyName, @@ -50,9 +50,9 @@ SyncPoller, ServiceUnitResourceInner> begin * @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 represents the response of a service unit resource. + * @return the {@link SyncPoller} for polling of represents the response of a service unit resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ServiceUnitResourceInner> beginCreateOrUpdate( String resourceGroupName, String serviceTopologyName, @@ -134,7 +134,7 @@ ServiceUnitResourceInner get( * @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 service unit. + * @return the service unit along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse( @@ -169,7 +169,7 @@ Response getWithResponse( * @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. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response deleteWithResponse( @@ -203,7 +203,7 @@ Response deleteWithResponse( * @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 list of service units. + * @return the list of service units along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response> listWithResponse( diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/ServicesClient.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/ServicesClient.java index 130e1d34a6384..073d6b862ddeb 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/ServicesClient.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/ServicesClient.java @@ -40,7 +40,7 @@ ServiceResourceInner createOrUpdate( * @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 resource representation of a service in a service topology. + * @return the resource representation of a service in a service topology along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response createOrUpdateWithResponse( @@ -74,7 +74,7 @@ Response createOrUpdateWithResponse( * @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 service. + * @return the service along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse( @@ -103,7 +103,7 @@ Response getWithResponse( * @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. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response deleteWithResponse( @@ -131,7 +131,7 @@ Response deleteWithResponse( * @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 list of services. + * @return the list of services along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response> listWithResponse( diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/StepsClient.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/StepsClient.java index d354d32b916ad..ede190f72c7af 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/StepsClient.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/StepsClient.java @@ -36,7 +36,7 @@ public interface StepsClient { * @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 resource representation of a rollout step. + * @return the resource representation of a rollout step along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response createOrUpdateWithResponse( @@ -64,7 +64,7 @@ Response createOrUpdateWithResponse( * @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 step. + * @return the step along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getByResourceGroupWithResponse( @@ -91,7 +91,7 @@ Response getByResourceGroupWithResponse( * @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. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response deleteWithResponse(String resourceGroupName, String stepName, Context context); @@ -116,7 +116,7 @@ Response getByResourceGroupWithResponse( * @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 list of steps. + * @return the list of steps along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response> listWithResponse(String resourceGroupName, Context context); diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/models/ArtifactSourceInner.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/models/ArtifactSourceInner.java index 18bf9a1f0d75a..af9bafa8ca440 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/models/ArtifactSourceInner.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/models/ArtifactSourceInner.java @@ -5,110 +5,26 @@ package com.azure.resourcemanager.deploymentmanager.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.deploymentmanager.models.Authentication; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; /** The resource that defines the source location where the artifacts are located. */ -@JsonFlatten @Fluent -public class ArtifactSourceInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ArtifactSourceInner.class); - +public final class ArtifactSourceInner extends Resource { /* - * The type of artifact source used. - */ - @JsonProperty(value = "properties.sourceType") - private String sourceType; - - /* - * The path from the location that the 'authentication' property [say, a - * SAS URI to the blob container] refers to, to the location of the - * artifacts. This can be used to differentiate different versions of the - * artifacts. Or, different types of artifacts like binaries or templates. - * The location referenced by the authentication property concatenated with - * this optional artifactRoot path forms the artifact source location where - * the artifacts are expected to be found. - */ - @JsonProperty(value = "properties.artifactRoot") - private String artifactRoot; - - /* - * The authentication method to use to access the artifact source. - */ - @JsonProperty(value = "properties.authentication") - private Authentication authentication; - - /** - * Get the sourceType property: The type of artifact source used. - * - * @return the sourceType value. + * The properties that define the artifact source. */ - public String sourceType() { - return this.sourceType; - } - - /** - * Set the sourceType property: The type of artifact source used. - * - * @param sourceType the sourceType value to set. - * @return the ArtifactSourceInner object itself. - */ - public ArtifactSourceInner withSourceType(String sourceType) { - this.sourceType = sourceType; - return this; - } + @JsonProperty(value = "properties") + private ArtifactSourceProperties innerProperties; /** - * Get the artifactRoot property: The path from the location that the 'authentication' property [say, a SAS URI to - * the blob container] refers to, to the location of the artifacts. This can be used to differentiate different - * versions of the artifacts. Or, different types of artifacts like binaries or templates. The location referenced - * by the authentication property concatenated with this optional artifactRoot path forms the artifact source - * location where the artifacts are expected to be found. + * Get the innerProperties property: The properties that define the artifact source. * - * @return the artifactRoot value. + * @return the innerProperties value. */ - public String artifactRoot() { - return this.artifactRoot; - } - - /** - * Set the artifactRoot property: The path from the location that the 'authentication' property [say, a SAS URI to - * the blob container] refers to, to the location of the artifacts. This can be used to differentiate different - * versions of the artifacts. Or, different types of artifacts like binaries or templates. The location referenced - * by the authentication property concatenated with this optional artifactRoot path forms the artifact source - * location where the artifacts are expected to be found. - * - * @param artifactRoot the artifactRoot value to set. - * @return the ArtifactSourceInner object itself. - */ - public ArtifactSourceInner withArtifactRoot(String artifactRoot) { - this.artifactRoot = artifactRoot; - return this; - } - - /** - * Get the authentication property: The authentication method to use to access the artifact source. - * - * @return the authentication value. - */ - public Authentication authentication() { - return this.authentication; - } - - /** - * Set the authentication property: The authentication method to use to access the artifact source. - * - * @param authentication the authentication value to set. - * @return the ArtifactSourceInner object itself. - */ - public ArtifactSourceInner withAuthentication(Authentication authentication) { - this.authentication = authentication; - return this; + private ArtifactSourceProperties innerProperties() { + return this.innerProperties; } /** {@inheritDoc} */ @@ -131,8 +47,8 @@ public ArtifactSourceInner withTags(Map tags) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (authentication() != null) { - authentication().validate(); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ArtifactSourceProperties.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/models/ArtifactSourceProperties.java similarity index 77% rename from sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ArtifactSourceProperties.java rename to sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/models/ArtifactSourceProperties.java index 6bc1870776d69..0ac9d795a000d 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ArtifactSourceProperties.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/models/ArtifactSourceProperties.java @@ -2,17 +2,15 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.deploymentmanager.models; +package com.azure.resourcemanager.deploymentmanager.fluent.models; -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.deploymentmanager.models.ArtifactSourcePropertiesAutoGenerated; +import com.azure.resourcemanager.deploymentmanager.models.Authentication; /** The properties that define the artifact source. */ -@Immutable +@Fluent public final class ArtifactSourceProperties extends ArtifactSourcePropertiesAutoGenerated { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ArtifactSourceProperties.class); - /** {@inheritDoc} */ @Override public ArtifactSourceProperties withSourceType(String sourceType) { diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/models/OperationsListInner.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/models/OperationsListInner.java index 61555aca17c25..8c2122e1906e9 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/models/OperationsListInner.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/models/OperationsListInner.java @@ -5,16 +5,12 @@ package com.azure.resourcemanager.deploymentmanager.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.deploymentmanager.models.Operation; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** The operations response. */ @Fluent public final class OperationsListInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsListInner.class); - /* * The list of supported operations */ diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/models/RestParameters.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/models/RestParameters.java new file mode 100644 index 0000000000000..828d295d93e85 --- /dev/null +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/models/RestParameters.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.deploymentmanager.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.deploymentmanager.models.RestHealthCheck; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The parameters for the REST health check. */ +@Fluent +public final class RestParameters { + /* + * The list of checks that form the health check step. + */ + @JsonProperty(value = "healthChecks", required = true) + private List healthChecks; + + /** + * Get the healthChecks property: The list of checks that form the health check step. + * + * @return the healthChecks value. + */ + public List healthChecks() { + return this.healthChecks; + } + + /** + * Set the healthChecks property: The list of checks that form the health check step. + * + * @param healthChecks the healthChecks value to set. + * @return the RestParameters object itself. + */ + public RestParameters withHealthChecks(List healthChecks) { + this.healthChecks = healthChecks; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (healthChecks() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property healthChecks in model RestParameters")); + } else { + healthChecks().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RestParameters.class); +} diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/models/RolloutInner.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/models/RolloutInner.java index 16bf84f5e31a2..73b60693bb709 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/models/RolloutInner.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/models/RolloutInner.java @@ -5,24 +5,18 @@ package com.azure.resourcemanager.deploymentmanager.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.deploymentmanager.models.Identity; import com.azure.resourcemanager.deploymentmanager.models.RolloutOperationInfo; import com.azure.resourcemanager.deploymentmanager.models.Service; import com.azure.resourcemanager.deploymentmanager.models.StepGroup; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; import java.util.Map; /** Defines the rollout. */ -@JsonFlatten @Fluent -public class RolloutInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RolloutInner.class); - +public final class RolloutInner extends Resource { /* * Identity for the resource. */ @@ -30,74 +24,89 @@ public class RolloutInner extends Resource { private Identity identity; /* - * The version of the build being deployed. + * The properties that define a rollout. */ - @JsonProperty(value = "properties.buildVersion") - private String buildVersion; + @JsonProperty(value = "properties") + private RolloutProperties innerProperties; - /* - * The reference to the artifact source resource Id where the payload is - * located. + /** + * Get the identity property: Identity for the resource. + * + * @return the identity value. */ - @JsonProperty(value = "properties.artifactSourceId") - private String artifactSourceId; + public Identity identity() { + return this.identity; + } - /* - * The resource Id of the service topology from which service units are - * being referenced in step groups to be deployed. + /** + * Set the identity property: Identity for the resource. + * + * @param identity the identity value to set. + * @return the RolloutInner object itself. */ - @JsonProperty(value = "properties.targetServiceTopologyId") - private String targetServiceTopologyId; + public RolloutInner withIdentity(Identity identity) { + this.identity = identity; + return this; + } - /* - * The list of step groups that define the orchestration. + /** + * Get the innerProperties property: The properties that define a rollout. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.stepGroups") - private List stepGroups; + private RolloutProperties innerProperties() { + return this.innerProperties; + } - /* - * The current status of the rollout. - */ - @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) - private String status; + /** {@inheritDoc} */ + @Override + public RolloutInner withLocation(String location) { + super.withLocation(location); + return this; + } - /* - * The cardinal count of total number of retries performed on the rollout - * at a given time. - */ - @JsonProperty(value = "properties.totalRetryAttempts", access = JsonProperty.Access.WRITE_ONLY) - private Integer totalRetryAttempts; + /** {@inheritDoc} */ + @Override + public RolloutInner withTags(Map tags) { + super.withTags(tags); + return this; + } - /* - * Operational information of the rollout. + /** + * Get the status property: The current status of the rollout. + * + * @return the status value. */ - @JsonProperty(value = "properties.operationInfo", access = JsonProperty.Access.WRITE_ONLY) - private RolloutOperationInfo operationInfo; + public String status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } - /* - * The detailed information on the services being deployed. + /** + * Get the totalRetryAttempts property: The cardinal count of total number of retries performed on the rollout at a + * given time. + * + * @return the totalRetryAttempts value. */ - @JsonProperty(value = "properties.services", access = JsonProperty.Access.WRITE_ONLY) - private List services; + public Integer totalRetryAttempts() { + return this.innerProperties() == null ? null : this.innerProperties().totalRetryAttempts(); + } /** - * Get the identity property: Identity for the resource. + * Get the operationInfo property: Operational information of the rollout. * - * @return the identity value. + * @return the operationInfo value. */ - public Identity identity() { - return this.identity; + public RolloutOperationInfo operationInfo() { + return this.innerProperties() == null ? null : this.innerProperties().operationInfo(); } /** - * Set the identity property: Identity for the resource. + * Get the services property: The detailed information on the services being deployed. * - * @param identity the identity value to set. - * @return the RolloutInner object itself. + * @return the services value. */ - public RolloutInner withIdentity(Identity identity) { - this.identity = identity; - return this; + public List services() { + return this.innerProperties() == null ? null : this.innerProperties().services(); } /** @@ -106,7 +115,7 @@ public RolloutInner withIdentity(Identity identity) { * @return the buildVersion value. */ public String buildVersion() { - return this.buildVersion; + return this.innerProperties() == null ? null : this.innerProperties().buildVersion(); } /** @@ -116,7 +125,10 @@ public String buildVersion() { * @return the RolloutInner object itself. */ public RolloutInner withBuildVersion(String buildVersion) { - this.buildVersion = buildVersion; + if (this.innerProperties() == null) { + this.innerProperties = new RolloutProperties(); + } + this.innerProperties().withBuildVersion(buildVersion); return this; } @@ -126,7 +138,7 @@ public RolloutInner withBuildVersion(String buildVersion) { * @return the artifactSourceId value. */ public String artifactSourceId() { - return this.artifactSourceId; + return this.innerProperties() == null ? null : this.innerProperties().artifactSourceId(); } /** @@ -136,7 +148,10 @@ public String artifactSourceId() { * @return the RolloutInner object itself. */ public RolloutInner withArtifactSourceId(String artifactSourceId) { - this.artifactSourceId = artifactSourceId; + if (this.innerProperties() == null) { + this.innerProperties = new RolloutProperties(); + } + this.innerProperties().withArtifactSourceId(artifactSourceId); return this; } @@ -147,7 +162,7 @@ public RolloutInner withArtifactSourceId(String artifactSourceId) { * @return the targetServiceTopologyId value. */ public String targetServiceTopologyId() { - return this.targetServiceTopologyId; + return this.innerProperties() == null ? null : this.innerProperties().targetServiceTopologyId(); } /** @@ -158,7 +173,10 @@ public String targetServiceTopologyId() { * @return the RolloutInner object itself. */ public RolloutInner withTargetServiceTopologyId(String targetServiceTopologyId) { - this.targetServiceTopologyId = targetServiceTopologyId; + if (this.innerProperties() == null) { + this.innerProperties = new RolloutProperties(); + } + this.innerProperties().withTargetServiceTopologyId(targetServiceTopologyId); return this; } @@ -168,7 +186,7 @@ public RolloutInner withTargetServiceTopologyId(String targetServiceTopologyId) * @return the stepGroups value. */ public List stepGroups() { - return this.stepGroups; + return this.innerProperties() == null ? null : this.innerProperties().stepGroups(); } /** @@ -178,58 +196,10 @@ public List stepGroups() { * @return the RolloutInner object itself. */ public RolloutInner withStepGroups(List stepGroups) { - this.stepGroups = stepGroups; - return this; - } - - /** - * Get the status property: The current status of the rollout. - * - * @return the status value. - */ - public String status() { - return this.status; - } - - /** - * Get the totalRetryAttempts property: The cardinal count of total number of retries performed on the rollout at a - * given time. - * - * @return the totalRetryAttempts value. - */ - public Integer totalRetryAttempts() { - return this.totalRetryAttempts; - } - - /** - * Get the operationInfo property: Operational information of the rollout. - * - * @return the operationInfo value. - */ - public RolloutOperationInfo operationInfo() { - return this.operationInfo; - } - - /** - * Get the services property: The detailed information on the services being deployed. - * - * @return the services value. - */ - public List services() { - return this.services; - } - - /** {@inheritDoc} */ - @Override - public RolloutInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public RolloutInner withTags(Map tags) { - super.withTags(tags); + if (this.innerProperties() == null) { + this.innerProperties = new RolloutProperties(); + } + this.innerProperties().withStepGroups(stepGroups); return this; } @@ -242,14 +212,8 @@ public void validate() { if (identity() != null) { identity().validate(); } - if (stepGroups() != null) { - stepGroups().forEach(e -> e.validate()); - } - if (operationInfo() != null) { - operationInfo().validate(); - } - if (services() != null) { - services().forEach(e -> e.validate()); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/RolloutProperties.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/models/RolloutProperties.java similarity index 90% rename from sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/RolloutProperties.java rename to sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/models/RolloutProperties.java index b93f35bd0be1b..32d57046318aa 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/RolloutProperties.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/models/RolloutProperties.java @@ -2,19 +2,18 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.deploymentmanager.models; +package com.azure.resourcemanager.deploymentmanager.fluent.models; -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.deploymentmanager.models.RolloutOperationInfo; +import com.azure.resourcemanager.deploymentmanager.models.Service; +import com.azure.resourcemanager.deploymentmanager.models.StepGroup; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** The properties that define a rollout. */ -@Immutable +@Fluent public final class RolloutProperties extends RolloutRequestProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RolloutProperties.class); - /* * The current status of the rollout. */ diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/models/RolloutRequestInner.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/models/RolloutRequestInner.java index 528f39e1dbe6b..fa9a20662e333 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/models/RolloutRequestInner.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/models/RolloutRequestInner.java @@ -5,22 +5,17 @@ package com.azure.resourcemanager.deploymentmanager.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.deploymentmanager.models.Identity; import com.azure.resourcemanager.deploymentmanager.models.StepGroup; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; import java.util.Map; /** Defines the PUT rollout request body. */ -@JsonFlatten @Fluent -public class RolloutRequestInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RolloutRequestInner.class); - +public final class RolloutRequestInner extends Resource { /* * Identity for the resource. */ @@ -28,30 +23,10 @@ public class RolloutRequestInner extends Resource { private Identity identity; /* - * The version of the build being deployed. - */ - @JsonProperty(value = "properties.buildVersion", required = true) - private String buildVersion; - - /* - * The reference to the artifact source resource Id where the payload is - * located. - */ - @JsonProperty(value = "properties.artifactSourceId") - private String artifactSourceId; - - /* - * The resource Id of the service topology from which service units are - * being referenced in step groups to be deployed. - */ - @JsonProperty(value = "properties.targetServiceTopologyId", required = true) - private String targetServiceTopologyId; - - /* - * The list of step groups that define the orchestration. + * Defines the properties that make up a rollout request. */ - @JsonProperty(value = "properties.stepGroups", required = true) - private List stepGroups; + @JsonProperty(value = "properties", required = true) + private RolloutRequestProperties innerProperties = new RolloutRequestProperties(); /** * Get the identity property: Identity for the resource. @@ -73,13 +48,36 @@ public RolloutRequestInner withIdentity(Identity identity) { return this; } + /** + * Get the innerProperties property: Defines the properties that make up a rollout request. + * + * @return the innerProperties value. + */ + private RolloutRequestProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public RolloutRequestInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public RolloutRequestInner withTags(Map tags) { + super.withTags(tags); + return this; + } + /** * Get the buildVersion property: The version of the build being deployed. * * @return the buildVersion value. */ public String buildVersion() { - return this.buildVersion; + return this.innerProperties() == null ? null : this.innerProperties().buildVersion(); } /** @@ -89,7 +87,10 @@ public String buildVersion() { * @return the RolloutRequestInner object itself. */ public RolloutRequestInner withBuildVersion(String buildVersion) { - this.buildVersion = buildVersion; + if (this.innerProperties() == null) { + this.innerProperties = new RolloutRequestProperties(); + } + this.innerProperties().withBuildVersion(buildVersion); return this; } @@ -99,7 +100,7 @@ public RolloutRequestInner withBuildVersion(String buildVersion) { * @return the artifactSourceId value. */ public String artifactSourceId() { - return this.artifactSourceId; + return this.innerProperties() == null ? null : this.innerProperties().artifactSourceId(); } /** @@ -109,7 +110,10 @@ public String artifactSourceId() { * @return the RolloutRequestInner object itself. */ public RolloutRequestInner withArtifactSourceId(String artifactSourceId) { - this.artifactSourceId = artifactSourceId; + if (this.innerProperties() == null) { + this.innerProperties = new RolloutRequestProperties(); + } + this.innerProperties().withArtifactSourceId(artifactSourceId); return this; } @@ -120,7 +124,7 @@ public RolloutRequestInner withArtifactSourceId(String artifactSourceId) { * @return the targetServiceTopologyId value. */ public String targetServiceTopologyId() { - return this.targetServiceTopologyId; + return this.innerProperties() == null ? null : this.innerProperties().targetServiceTopologyId(); } /** @@ -131,7 +135,10 @@ public String targetServiceTopologyId() { * @return the RolloutRequestInner object itself. */ public RolloutRequestInner withTargetServiceTopologyId(String targetServiceTopologyId) { - this.targetServiceTopologyId = targetServiceTopologyId; + if (this.innerProperties() == null) { + this.innerProperties = new RolloutRequestProperties(); + } + this.innerProperties().withTargetServiceTopologyId(targetServiceTopologyId); return this; } @@ -141,7 +148,7 @@ public RolloutRequestInner withTargetServiceTopologyId(String targetServiceTopol * @return the stepGroups value. */ public List stepGroups() { - return this.stepGroups; + return this.innerProperties() == null ? null : this.innerProperties().stepGroups(); } /** @@ -151,21 +158,10 @@ public List stepGroups() { * @return the RolloutRequestInner object itself. */ public RolloutRequestInner withStepGroups(List stepGroups) { - this.stepGroups = stepGroups; - return this; - } - - /** {@inheritDoc} */ - @Override - public RolloutRequestInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public RolloutRequestInner withTags(Map tags) { - super.withTags(tags); + if (this.innerProperties() == null) { + this.innerProperties = new RolloutRequestProperties(); + } + this.innerProperties().withStepGroups(stepGroups); return this; } @@ -176,30 +172,21 @@ public RolloutRequestInner withTags(Map tags) { */ public void validate() { if (identity() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property identity in model RolloutRequestInner")); } else { identity().validate(); } - if (buildVersion() == null) { - throw logger + if (innerProperties() == null) { + throw LOGGER .logExceptionAsError( new IllegalArgumentException( - "Missing required property buildVersion in model RolloutRequestInner")); - } - if (targetServiceTopologyId() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property targetServiceTopologyId in model RolloutRequestInner")); - } - if (stepGroups() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property stepGroups in model RolloutRequestInner")); + "Missing required property innerProperties in model RolloutRequestInner")); } else { - stepGroups().forEach(e -> e.validate()); + innerProperties().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(RolloutRequestInner.class); } diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/RolloutRequestProperties.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/models/RolloutRequestProperties.java similarity index 94% rename from sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/RolloutRequestProperties.java rename to sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/models/RolloutRequestProperties.java index 439bcc519eb98..4024061160b31 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/RolloutRequestProperties.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/models/RolloutRequestProperties.java @@ -2,19 +2,17 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.deploymentmanager.models; +package com.azure.resourcemanager.deploymentmanager.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.resourcemanager.deploymentmanager.models.StepGroup; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** The properties for defining a rollout. */ @Fluent public class RolloutRequestProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RolloutRequestProperties.class); - /* * The version of the build being deployed. */ @@ -130,19 +128,19 @@ public RolloutRequestProperties withStepGroups(List stepGroups) { */ public void validate() { if (buildVersion() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property buildVersion in model RolloutRequestProperties")); } if (targetServiceTopologyId() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property targetServiceTopologyId in model RolloutRequestProperties")); } if (stepGroups() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property stepGroups in model RolloutRequestProperties")); @@ -150,4 +148,6 @@ public void validate() { stepGroups().forEach(e -> e.validate()); } } + + private static final ClientLogger LOGGER = new ClientLogger(RolloutRequestProperties.class); } diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/models/SasProperties.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/models/SasProperties.java new file mode 100644 index 0000000000000..bf59415337395 --- /dev/null +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/models/SasProperties.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.deploymentmanager.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties that define SAS authentication. */ +@Fluent +public final class SasProperties { + /* + * The SAS URI to the Azure Storage blob container. Any offset from the + * root of the container to where the artifacts are located can be defined + * in the artifactRoot. + */ + @JsonProperty(value = "sasUri", required = true) + private String sasUri; + + /** + * Get the sasUri property: The SAS URI to the Azure Storage blob container. Any offset from the root of the + * container to where the artifacts are located can be defined in the artifactRoot. + * + * @return the sasUri value. + */ + public String sasUri() { + return this.sasUri; + } + + /** + * Set the sasUri property: The SAS URI to the Azure Storage blob container. Any offset from the root of the + * container to where the artifacts are located can be defined in the artifactRoot. + * + * @param sasUri the sasUri value to set. + * @return the SasProperties object itself. + */ + public SasProperties withSasUri(String sasUri) { + this.sasUri = sasUri; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sasUri() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property sasUri in model SasProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SasProperties.class); +} diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/models/ServiceResourceInner.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/models/ServiceResourceInner.java index e79ad40f96827..538cd84f2a275 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/models/ServiceResourceInner.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/models/ServiceResourceInner.java @@ -5,75 +5,27 @@ package com.azure.resourcemanager.deploymentmanager.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; /** The resource representation of a service in a service topology. */ -@JsonFlatten @Fluent -public class ServiceResourceInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceResourceInner.class); - - /* - * The Azure location to which the resources in the service belong to or - * should be deployed to. - */ - @JsonProperty(value = "properties.targetLocation", required = true) - private String targetLocation; - +public final class ServiceResourceInner extends Resource { /* - * The subscription to which the resources in the service belong to or - * should be deployed to. + * The properties that define a service in a service topology. */ - @JsonProperty(value = "properties.targetSubscriptionId", required = true) - private String targetSubscriptionId; + @JsonProperty(value = "properties", required = true) + private ServiceResourceProperties innerProperties = new ServiceResourceProperties(); /** - * Get the targetLocation property: The Azure location to which the resources in the service belong to or should be - * deployed to. + * Get the innerProperties property: The properties that define a service in a service topology. * - * @return the targetLocation value. + * @return the innerProperties value. */ - public String targetLocation() { - return this.targetLocation; - } - - /** - * Set the targetLocation property: The Azure location to which the resources in the service belong to or should be - * deployed to. - * - * @param targetLocation the targetLocation value to set. - * @return the ServiceResourceInner object itself. - */ - public ServiceResourceInner withTargetLocation(String targetLocation) { - this.targetLocation = targetLocation; - return this; - } - - /** - * Get the targetSubscriptionId property: The subscription to which the resources in the service belong to or should - * be deployed to. - * - * @return the targetSubscriptionId value. - */ - public String targetSubscriptionId() { - return this.targetSubscriptionId; - } - - /** - * Set the targetSubscriptionId property: The subscription to which the resources in the service belong to or should - * be deployed to. - * - * @param targetSubscriptionId the targetSubscriptionId value to set. - * @return the ServiceResourceInner object itself. - */ - public ServiceResourceInner withTargetSubscriptionId(String targetSubscriptionId) { - this.targetSubscriptionId = targetSubscriptionId; - return this; + private ServiceResourceProperties innerProperties() { + return this.innerProperties; } /** {@inheritDoc} */ @@ -96,17 +48,15 @@ public ServiceResourceInner withTags(Map tags) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (targetLocation() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property targetLocation in model ServiceResourceInner")); - } - if (targetSubscriptionId() == null) { - throw logger + if (innerProperties() == null) { + throw LOGGER .logExceptionAsError( new IllegalArgumentException( - "Missing required property targetSubscriptionId in model ServiceResourceInner")); + "Missing required property innerProperties in model ServiceResourceInner")); + } else { + innerProperties().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(ServiceResourceInner.class); } diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ServiceResourceProperties.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/models/ServiceResourceProperties.java similarity index 74% rename from sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ServiceResourceProperties.java rename to sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/models/ServiceResourceProperties.java index c846a0ecd9af5..4e026552a53ec 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ServiceResourceProperties.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/models/ServiceResourceProperties.java @@ -2,17 +2,14 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.deploymentmanager.models; +package com.azure.resourcemanager.deploymentmanager.fluent.models; -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.deploymentmanager.models.ServiceProperties; /** The properties that define a service in a service topology. */ -@Immutable +@Fluent public final class ServiceResourceProperties extends ServiceProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceResourceProperties.class); - /** {@inheritDoc} */ @Override public ServiceResourceProperties withTargetLocation(String targetLocation) { diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/models/ServiceTopologyResourceInner.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/models/ServiceTopologyResourceInner.java index c496a72a722e3..f8e144e6d8c09 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/models/ServiceTopologyResourceInner.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/models/ServiceTopologyResourceInner.java @@ -5,46 +5,27 @@ package com.azure.resourcemanager.deploymentmanager.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; /** The resource representation of a service topology. */ -@JsonFlatten @Fluent -public class ServiceTopologyResourceInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceTopologyResourceInner.class); - +public final class ServiceTopologyResourceInner extends Resource { /* - * The resource Id of the artifact source that contains the artifacts that - * can be referenced in the service units. - */ - @JsonProperty(value = "properties.artifactSourceId") - private String artifactSourceId; - - /** - * Get the artifactSourceId property: The resource Id of the artifact source that contains the artifacts that can be - * referenced in the service units. - * - * @return the artifactSourceId value. + * The properties that define the service topology. */ - public String artifactSourceId() { - return this.artifactSourceId; - } + @JsonProperty(value = "properties", required = true) + private ServiceTopologyResourceProperties innerProperties = new ServiceTopologyResourceProperties(); /** - * Set the artifactSourceId property: The resource Id of the artifact source that contains the artifacts that can be - * referenced in the service units. + * Get the innerProperties property: The properties that define the service topology. * - * @param artifactSourceId the artifactSourceId value to set. - * @return the ServiceTopologyResourceInner object itself. + * @return the innerProperties value. */ - public ServiceTopologyResourceInner withArtifactSourceId(String artifactSourceId) { - this.artifactSourceId = artifactSourceId; - return this; + private ServiceTopologyResourceProperties innerProperties() { + return this.innerProperties; } /** {@inheritDoc} */ @@ -67,5 +48,15 @@ public ServiceTopologyResourceInner withTags(Map tags) { * @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 ServiceTopologyResourceInner")); + } else { + innerProperties().validate(); + } } + + private static final ClientLogger LOGGER = new ClientLogger(ServiceTopologyResourceInner.class); } diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ServiceTopologyResourceProperties.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/models/ServiceTopologyResourceProperties.java similarity index 68% rename from sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ServiceTopologyResourceProperties.java rename to sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/models/ServiceTopologyResourceProperties.java index e2874a346f756..86de44380d883 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ServiceTopologyResourceProperties.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/models/ServiceTopologyResourceProperties.java @@ -2,17 +2,14 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.deploymentmanager.models; +package com.azure.resourcemanager.deploymentmanager.fluent.models; -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.deploymentmanager.models.ServiceTopologyProperties; /** The properties that define the service topology. */ -@Immutable +@Fluent public final class ServiceTopologyResourceProperties extends ServiceTopologyProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceTopologyResourceProperties.class); - /** {@inheritDoc} */ @Override public ServiceTopologyResourceProperties withArtifactSourceId(String artifactSourceId) { diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/models/ServiceUnitResourceInner.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/models/ServiceUnitResourceInner.java index 2472e22896994..4b625c48b70fe 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/models/ServiceUnitResourceInner.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/models/ServiceUnitResourceInner.java @@ -5,100 +5,27 @@ package com.azure.resourcemanager.deploymentmanager.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.deploymentmanager.models.DeploymentMode; -import com.azure.resourcemanager.deploymentmanager.models.ServiceUnitArtifacts; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; /** Represents the response of a service unit resource. */ -@JsonFlatten @Fluent -public class ServiceUnitResourceInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceUnitResourceInner.class); - - /* - * The Azure Resource Group to which the resources in the service unit - * belong to or should be deployed to. - */ - @JsonProperty(value = "properties.targetResourceGroup", required = true) - private String targetResourceGroup; - - /* - * Describes the type of ARM deployment to be performed on the resource. - */ - @JsonProperty(value = "properties.deploymentMode", required = true) - private DeploymentMode deploymentMode; - +public final class ServiceUnitResourceInner extends Resource { /* - * The artifacts for the service unit. - */ - @JsonProperty(value = "properties.artifacts") - private ServiceUnitArtifacts artifacts; - - /** - * Get the targetResourceGroup property: The Azure Resource Group to which the resources in the service unit belong - * to or should be deployed to. - * - * @return the targetResourceGroup value. - */ - public String targetResourceGroup() { - return this.targetResourceGroup; - } - - /** - * Set the targetResourceGroup property: The Azure Resource Group to which the resources in the service unit belong - * to or should be deployed to. - * - * @param targetResourceGroup the targetResourceGroup value to set. - * @return the ServiceUnitResourceInner object itself. - */ - public ServiceUnitResourceInner withTargetResourceGroup(String targetResourceGroup) { - this.targetResourceGroup = targetResourceGroup; - return this; - } - - /** - * Get the deploymentMode property: Describes the type of ARM deployment to be performed on the resource. - * - * @return the deploymentMode value. - */ - public DeploymentMode deploymentMode() { - return this.deploymentMode; - } - - /** - * Set the deploymentMode property: Describes the type of ARM deployment to be performed on the resource. - * - * @param deploymentMode the deploymentMode value to set. - * @return the ServiceUnitResourceInner object itself. - */ - public ServiceUnitResourceInner withDeploymentMode(DeploymentMode deploymentMode) { - this.deploymentMode = deploymentMode; - return this; - } - - /** - * Get the artifacts property: The artifacts for the service unit. - * - * @return the artifacts value. + * The properties that define the service unit. */ - public ServiceUnitArtifacts artifacts() { - return this.artifacts; - } + @JsonProperty(value = "properties", required = true) + private ServiceUnitResourceProperties innerProperties = new ServiceUnitResourceProperties(); /** - * Set the artifacts property: The artifacts for the service unit. + * Get the innerProperties property: The properties that define the service unit. * - * @param artifacts the artifacts value to set. - * @return the ServiceUnitResourceInner object itself. + * @return the innerProperties value. */ - public ServiceUnitResourceInner withArtifacts(ServiceUnitArtifacts artifacts) { - this.artifacts = artifacts; - return this; + private ServiceUnitResourceProperties innerProperties() { + return this.innerProperties; } /** {@inheritDoc} */ @@ -121,20 +48,15 @@ public ServiceUnitResourceInner withTags(Map tags) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (targetResourceGroup() == null) { - throw logger + if (innerProperties() == null) { + throw LOGGER .logExceptionAsError( new IllegalArgumentException( - "Missing required property targetResourceGroup in model ServiceUnitResourceInner")); - } - if (deploymentMode() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property deploymentMode in model ServiceUnitResourceInner")); - } - if (artifacts() != null) { - artifacts().validate(); + "Missing required property innerProperties in model ServiceUnitResourceInner")); + } else { + innerProperties().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(ServiceUnitResourceInner.class); } diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ServiceUnitResourceProperties.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/models/ServiceUnitResourceProperties.java similarity index 76% rename from sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ServiceUnitResourceProperties.java rename to sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/models/ServiceUnitResourceProperties.java index a0635d1451d61..12a262ad599ea 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ServiceUnitResourceProperties.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/models/ServiceUnitResourceProperties.java @@ -2,17 +2,16 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.deploymentmanager.models; +package com.azure.resourcemanager.deploymentmanager.fluent.models; -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.deploymentmanager.models.DeploymentMode; +import com.azure.resourcemanager.deploymentmanager.models.ServiceUnitArtifacts; +import com.azure.resourcemanager.deploymentmanager.models.ServiceUnitProperties; /** The properties that define the service unit. */ -@Immutable +@Fluent public final class ServiceUnitResourceProperties extends ServiceUnitProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceUnitResourceProperties.class); - /** {@inheritDoc} */ @Override public ServiceUnitResourceProperties withTargetResourceGroup(String targetResourceGroup) { diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/models/StepResourceInner.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/models/StepResourceInner.java index 3040041be1efe..fbd0527449b7b 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/models/StepResourceInner.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/models/StepResourceInner.java @@ -8,15 +8,12 @@ import com.azure.core.management.Resource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.deploymentmanager.models.StepProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; /** The resource representation of a rollout step. */ @Fluent public final class StepResourceInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(StepResourceInner.class); - /* * The properties that define the step. */ @@ -64,11 +61,13 @@ public StepResourceInner withTags(Map tags) { */ public void validate() { if (properties() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property properties in model StepResourceInner")); } else { properties().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(StepResourceInner.class); } diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/models/package-info.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/models/package-info.java index 4247ac6f220ea..7cc5535347d89 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/models/package-info.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/models/package-info.java @@ -5,6 +5,6 @@ /** * Package containing the inner data models for AzureDeploymentManager. REST APIs for orchestrating deployments using * the Azure Deployment Manager (ADM). See - * https://docs.microsoft.com/azure/azure-resource-manager/deployment-manager-overview for more information. + * https://docs.microsoft.com/en-us/azure/azure-resource-manager/deployment-manager-overview for more information. */ package com.azure.resourcemanager.deploymentmanager.fluent.models; diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/package-info.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/package-info.java index b773ef427af36..9230ccea9da41 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/package-info.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/fluent/package-info.java @@ -5,6 +5,6 @@ /** * Package containing the service clients for AzureDeploymentManager. REST APIs for orchestrating deployments using the * Azure Deployment Manager (ADM). See - * https://docs.microsoft.com/azure/azure-resource-manager/deployment-manager-overview for more information. + * https://docs.microsoft.com/en-us/azure/azure-resource-manager/deployment-manager-overview for more information. */ package com.azure.resourcemanager.deploymentmanager.fluent; diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/ArtifactSourceImpl.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/ArtifactSourceImpl.java index c3daf0df59628..99679d68d0934 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/ArtifactSourceImpl.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/ArtifactSourceImpl.java @@ -8,7 +8,6 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.deploymentmanager.fluent.models.ArtifactSourceInner; import com.azure.resourcemanager.deploymentmanager.models.ArtifactSource; -import com.azure.resourcemanager.deploymentmanager.models.Authentication; import java.util.Collections; import java.util.Map; @@ -42,18 +41,6 @@ public Map tags() { } } - public String sourceType() { - return this.innerModel().sourceType(); - } - - public String artifactRoot() { - return this.innerModel().artifactRoot(); - } - - public Authentication authentication() { - return this.innerModel().authentication(); - } - public Region region() { return Region.fromName(this.regionName()); } @@ -62,6 +49,10 @@ public String regionName() { return this.location(); } + public String resourceGroupName() { + return resourceGroupName; + } + public ArtifactSourceInner innerModel() { return this.innerObject; } @@ -171,19 +162,4 @@ public ArtifactSourceImpl withTags(Map tags) { this.innerModel().withTags(tags); return this; } - - public ArtifactSourceImpl withSourceType(String sourceType) { - this.innerModel().withSourceType(sourceType); - return this; - } - - public ArtifactSourceImpl withArtifactRoot(String artifactRoot) { - this.innerModel().withArtifactRoot(artifactRoot); - return this; - } - - public ArtifactSourceImpl withAuthentication(Authentication authentication) { - this.innerModel().withAuthentication(authentication); - return this; - } } diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/ArtifactSourcesClientImpl.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/ArtifactSourcesClientImpl.java index 958dd4083f08f..152b483a1ba18 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/ArtifactSourcesClientImpl.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/ArtifactSourcesClientImpl.java @@ -24,7 +24,6 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.deploymentmanager.fluent.ArtifactSourcesClient; import com.azure.resourcemanager.deploymentmanager.fluent.models.ArtifactSourceInner; import java.util.List; @@ -32,8 +31,6 @@ /** An instance of this class provides access to all the operations defined in ArtifactSourcesClient. */ public final class ArtifactSourcesClientImpl implements ArtifactSourcesClient { - private final ClientLogger logger = new ClientLogger(ArtifactSourcesClientImpl.class); - /** The proxy service used to perform REST calls. */ private final ArtifactSourcesService service; @@ -128,7 +125,8 @@ Mono>> list( * @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 resource that defines the source location where the artifacts are located. + * @return the resource that defines the source location where the artifacts are located along with {@link Response} + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -183,7 +181,8 @@ 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 the resource that defines the source location where the artifacts are located. + * @return the resource that defines the source location where the artifacts are located along with {@link Response} + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -234,20 +233,14 @@ 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 the resource that defines the source location where the artifacts are located. + * @return the resource that defines the source location where the artifacts are located on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( String resourceGroupName, String artifactSourceName, ArtifactSourceInner artifactSourceInfo) { return createOrUpdateWithResponseAsync(resourceGroupName, artifactSourceName, artifactSourceInfo) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -258,20 +251,14 @@ private Mono createOrUpdateAsync( * @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 resource that defines the source location where the artifacts are located. + * @return the resource that defines the source location where the artifacts are located on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String resourceGroupName, String artifactSourceName) { final ArtifactSourceInner artifactSourceInfo = null; return createOrUpdateWithResponseAsync(resourceGroupName, artifactSourceName, artifactSourceInfo) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -300,7 +287,8 @@ public ArtifactSourceInner createOrUpdate(String resourceGroupName, String artif * @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 resource that defines the source location where the artifacts are located. + * @return the resource that defines the source location where the artifacts are located along with {@link + * Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse( @@ -317,7 +305,7 @@ public Response createOrUpdateWithResponse( * @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 an artifact source. + * @return an artifact source along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -367,7 +355,7 @@ private Mono> getByResourceGroupWithResponseAsync( * @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 an artifact source. + * @return an artifact source along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -413,19 +401,12 @@ private Mono> getByResourceGroupWithResponseAsync( * @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 an artifact source. + * @return an artifact source on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByResourceGroupAsync(String resourceGroupName, String artifactSourceName) { return getByResourceGroupWithResponseAsync(resourceGroupName, artifactSourceName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -452,7 +433,7 @@ public ArtifactSourceInner getByResourceGroup(String resourceGroupName, String a * @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 an artifact source. + * @return an artifact source along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse( @@ -468,7 +449,7 @@ public Response getByResourceGroupWithResponse( * @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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync(String resourceGroupName, String artifactSourceName) { @@ -517,7 +498,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * @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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync( @@ -563,12 +544,11 @@ private Mono> deleteWithResponseAsync( * @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 completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String artifactSourceName) { - return deleteWithResponseAsync(resourceGroupName, artifactSourceName) - .flatMap((Response res) -> Mono.empty()); + return deleteWithResponseAsync(resourceGroupName, artifactSourceName).flatMap(ignored -> Mono.empty()); } /** @@ -594,7 +574,7 @@ public void delete(String resourceGroupName, String artifactSourceName) { * @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. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(String resourceGroupName, String artifactSourceName, Context context) { @@ -608,7 +588,7 @@ public Response deleteWithResponse(String resourceGroupName, String artifa * @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 list of artifact sources. + * @return the list of artifact sources along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> listWithResponseAsync(String resourceGroupName) { @@ -651,7 +631,7 @@ private Mono>> listWithResponseAsync(String r * @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 list of artifact sources. + * @return the list of artifact sources along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> listWithResponseAsync(String resourceGroupName, Context context) { @@ -690,19 +670,11 @@ private Mono>> listWithResponseAsync(String r * @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 list of artifact sources. + * @return the list of artifact sources on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listAsync(String resourceGroupName) { - return listWithResponseAsync(resourceGroupName) - .flatMap( - (Response> res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + return listWithResponseAsync(resourceGroupName).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -727,7 +699,7 @@ public List list(String resourceGroupName) { * @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 list of artifact sources. + * @return the list of artifact sources along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response> listWithResponse(String resourceGroupName, Context context) { diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/ArtifactSourcesImpl.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/ArtifactSourcesImpl.java index 3263cb1ee83a7..c9876745d52c9 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/ArtifactSourcesImpl.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/ArtifactSourcesImpl.java @@ -12,13 +12,12 @@ import com.azure.resourcemanager.deploymentmanager.fluent.models.ArtifactSourceInner; import com.azure.resourcemanager.deploymentmanager.models.ArtifactSource; import com.azure.resourcemanager.deploymentmanager.models.ArtifactSources; -import com.fasterxml.jackson.annotation.JsonIgnore; import java.util.Collections; import java.util.List; import java.util.stream.Collectors; public final class ArtifactSourcesImpl implements ArtifactSources { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ArtifactSourcesImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(ArtifactSourcesImpl.class); private final ArtifactSourcesClient innerClient; @@ -97,7 +96,7 @@ public Response> listWithResponse(String resourceGroupName, public ArtifactSource getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -105,7 +104,7 @@ public ArtifactSource getById(String id) { } String artifactSourceName = Utils.getValueFromIdByName(id, "artifactSources"); if (artifactSourceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -117,7 +116,7 @@ public ArtifactSource getById(String id) { public Response getByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -125,7 +124,7 @@ public Response getByIdWithResponse(String id, Context context) } String artifactSourceName = Utils.getValueFromIdByName(id, "artifactSources"); if (artifactSourceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -137,7 +136,7 @@ public Response getByIdWithResponse(String id, Context context) public void deleteById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -145,19 +144,19 @@ public void deleteById(String id) { } String artifactSourceName = Utils.getValueFromIdByName(id, "artifactSources"); if (artifactSourceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String .format("The resource ID '%s' is not valid. Missing path segment 'artifactSources'.", id))); } - this.deleteWithResponse(resourceGroupName, artifactSourceName, Context.NONE).getValue(); + this.deleteWithResponse(resourceGroupName, artifactSourceName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -165,7 +164,7 @@ public Response deleteByIdWithResponse(String id, Context context) { } String artifactSourceName = Utils.getValueFromIdByName(id, "artifactSources"); if (artifactSourceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/AzureDeploymentManagerBuilder.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/AzureDeploymentManagerBuilder.java index 749309f9da1f9..bc95d59b2826c 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/AzureDeploymentManagerBuilder.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/AzureDeploymentManagerBuilder.java @@ -7,7 +7,6 @@ import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.policy.CookiePolicy; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.management.AzureEnvironment; @@ -70,34 +69,34 @@ public AzureDeploymentManagerBuilder environment(AzureEnvironment environment) { } /* - * The default poll interval for long-running operation + * The HTTP pipeline to send requests through */ - private Duration defaultPollInterval; + private HttpPipeline pipeline; /** - * Sets The default poll interval for long-running operation. + * Sets The HTTP pipeline to send requests through. * - * @param defaultPollInterval the defaultPollInterval value. + * @param pipeline the pipeline value. * @return the AzureDeploymentManagerBuilder. */ - public AzureDeploymentManagerBuilder defaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = defaultPollInterval; + public AzureDeploymentManagerBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; return this; } /* - * The HTTP pipeline to send requests through + * The default poll interval for long-running operation */ - private HttpPipeline pipeline; + private Duration defaultPollInterval; /** - * Sets The HTTP pipeline to send requests through. + * Sets The default poll interval for long-running operation. * - * @param pipeline the pipeline value. + * @param defaultPollInterval the defaultPollInterval value. * @return the AzureDeploymentManagerBuilder. */ - public AzureDeploymentManagerBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; + public AzureDeploymentManagerBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; return this; } @@ -129,15 +128,12 @@ public AzureDeploymentManagerImpl buildClient() { if (environment == null) { this.environment = AzureEnvironment.AZURE; } + if (pipeline == null) { + this.pipeline = new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + } if (defaultPollInterval == null) { this.defaultPollInterval = Duration.ofSeconds(30); } - if (pipeline == null) { - this.pipeline = - new HttpPipelineBuilder() - .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) - .build(); - } if (serializerAdapter == null) { this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); } diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/AzureDeploymentManagerImpl.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/AzureDeploymentManagerImpl.java index e4f27d4c4ae53..d865282b33dca 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/AzureDeploymentManagerImpl.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/AzureDeploymentManagerImpl.java @@ -15,6 +15,7 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.management.polling.PollerFactory; import com.azure.core.util.Context; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.AsyncPollResponse; import com.azure.core.util.polling.LongRunningOperationStatus; @@ -35,15 +36,12 @@ import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.time.Duration; -import java.util.Map; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; /** Initializes a new instance of the AzureDeploymentManagerImpl type. */ @ServiceClient(builder = AzureDeploymentManagerBuilder.class) public final class AzureDeploymentManagerImpl implements AzureDeploymentManager { - private final ClientLogger logger = new ClientLogger(AzureDeploymentManagerImpl.class); - /** * Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of * the URI for every service call. @@ -253,10 +251,7 @@ public Context getContext() { * @return the merged context. */ public Context mergeContext(Context context) { - for (Map.Entry entry : this.getContext().getValues().entrySet()) { - context = context.addData(entry.getKey(), entry.getValue()); - } - return context; + return CoreUtils.mergeContexts(this.getContext(), context); } /** @@ -320,7 +315,7 @@ public Mono getLroFinalResultOrError(AsyncPollResponse, managementError = null; } } catch (IOException | RuntimeException ioe) { - logger.logThrowableAsWarning(ioe); + LOGGER.logThrowableAsWarning(ioe); } } } else { @@ -379,4 +374,6 @@ public Mono getBodyAsString(Charset charset) { return Mono.just(new String(responseBody, charset)); } } + + private static final ClientLogger LOGGER = new ClientLogger(AzureDeploymentManagerImpl.class); } diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/OperationsClientImpl.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/OperationsClientImpl.java index cdcd24d5683d2..89d332cc9720f 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/OperationsClientImpl.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/OperationsClientImpl.java @@ -20,15 +20,12 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.deploymentmanager.fluent.OperationsClient; import com.azure.resourcemanager.deploymentmanager.fluent.models.OperationsListInner; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in OperationsClient. */ public final class OperationsClientImpl implements OperationsClient { - private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final OperationsService service; @@ -69,7 +66,7 @@ Mono> list( * * @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 operations response. + * @return the operations response along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listWithResponseAsync() { @@ -93,7 +90,7 @@ private Mono> listWithResponseAsync() { * @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 operations response. + * @return the operations response along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listWithResponseAsync(Context context) { @@ -113,19 +110,11 @@ private Mono> listWithResponseAsync(Context contex * * @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 operations response. + * @return the operations response on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono listAsync() { - return listWithResponseAsync() - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + return listWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -147,7 +136,7 @@ public OperationsListInner list() { * @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 operations response. + * @return the operations response along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response listWithResponse(Context context) { diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/OperationsImpl.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/OperationsImpl.java index 76b2529d3784e..ba67ca0c5a9fd 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/OperationsImpl.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/OperationsImpl.java @@ -12,10 +12,9 @@ import com.azure.resourcemanager.deploymentmanager.fluent.models.OperationsListInner; import com.azure.resourcemanager.deploymentmanager.models.Operations; import com.azure.resourcemanager.deploymentmanager.models.OperationsList; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class OperationsImpl implements Operations { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); private final OperationsClient innerClient; diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/RolloutImpl.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/RolloutImpl.java index cf50254501a44..29c6150e0d825 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/RolloutImpl.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/RolloutImpl.java @@ -54,20 +54,20 @@ public Identity identity() { return this.innerModel().identity(); } - public String buildVersion() { - return this.innerModel().buildVersion(); + public String status() { + return this.innerModel().status(); } - public String artifactSourceId() { - return this.innerModel().artifactSourceId(); + public Integer totalRetryAttempts() { + return this.innerModel().totalRetryAttempts(); } - public String targetServiceTopologyId() { - return this.innerModel().targetServiceTopologyId(); + public RolloutOperationInfo operationInfo() { + return this.innerModel().operationInfo(); } - public List stepGroups() { - List inner = this.innerModel().stepGroups(); + public List services() { + List inner = this.innerModel().services(); if (inner != null) { return Collections.unmodifiableList(inner); } else { @@ -75,20 +75,20 @@ public List stepGroups() { } } - public String status() { - return this.innerModel().status(); + public String buildVersion() { + return this.innerModel().buildVersion(); } - public Integer totalRetryAttempts() { - return this.innerModel().totalRetryAttempts(); + public String artifactSourceId() { + return this.innerModel().artifactSourceId(); } - public RolloutOperationInfo operationInfo() { - return this.innerModel().operationInfo(); + public String targetServiceTopologyId() { + return this.innerModel().targetServiceTopologyId(); } - public List services() { - List inner = this.innerModel().services(); + public List stepGroups() { + List inner = this.innerModel().stepGroups(); if (inner != null) { return Collections.unmodifiableList(inner); } else { diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/RolloutRequestImpl.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/RolloutRequestImpl.java index 44e59c03bb1d5..ef09bdedf272a 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/RolloutRequestImpl.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/RolloutRequestImpl.java @@ -79,6 +79,10 @@ public String regionName() { return this.location(); } + public String resourceGroupName() { + return resourceGroupName; + } + public RolloutRequestInner innerModel() { return this.innerObject; } diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/RolloutsClientImpl.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/RolloutsClientImpl.java index d634ec045b7b9..447f9b301fafc 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/RolloutsClientImpl.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/RolloutsClientImpl.java @@ -26,7 +26,6 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.deploymentmanager.fluent.RolloutsClient; @@ -39,8 +38,6 @@ /** An instance of this class provides access to all the operations defined in RolloutsClient. */ public final class RolloutsClientImpl implements RolloutsClient { - private final ClientLogger logger = new ClientLogger(RolloutsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final RolloutsService service; @@ -167,7 +164,8 @@ Mono>> list( * @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 defines the PUT rollout request body. + * @return defines the PUT rollout request body along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( @@ -222,7 +220,8 @@ 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 defines the PUT rollout request body. + * @return defines the PUT rollout request body along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( @@ -273,9 +272,9 @@ 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 defines the PUT rollout request body. + * @return the {@link PollerFlux} for polling of defines the PUT rollout request body. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, RolloutRequestInner> beginCreateOrUpdateAsync( String resourceGroupName, String rolloutName, RolloutRequestInner rolloutRequest) { Mono>> mono = @@ -287,7 +286,7 @@ private PollerFlux, RolloutRequestInner> beginCr this.client.getHttpPipeline(), RolloutRequestInner.class, RolloutRequestInner.class, - Context.NONE); + this.client.getContext()); } /** @@ -301,9 +300,9 @@ private PollerFlux, RolloutRequestInner> beginCr * @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 defines the PUT rollout request body. + * @return the {@link PollerFlux} for polling of defines the PUT rollout request body. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, RolloutRequestInner> beginCreateOrUpdateAsync( String resourceGroupName, String rolloutName, RolloutRequestInner rolloutRequest, Context context) { context = this.client.mergeContext(context); @@ -325,9 +324,9 @@ private PollerFlux, RolloutRequestInner> beginCr * @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 defines the PUT rollout request body. + * @return the {@link SyncPoller} for polling of defines the PUT rollout request body. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, RolloutRequestInner> beginCreateOrUpdate( String resourceGroupName, String rolloutName, RolloutRequestInner rolloutRequest) { return beginCreateOrUpdateAsync(resourceGroupName, rolloutName, rolloutRequest).getSyncPoller(); @@ -344,9 +343,9 @@ public SyncPoller, RolloutRequestInner> beginCre * @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 defines the PUT rollout request body. + * @return the {@link SyncPoller} for polling of defines the PUT rollout request body. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, RolloutRequestInner> beginCreateOrUpdate( String resourceGroupName, String rolloutName, RolloutRequestInner rolloutRequest, Context context) { return beginCreateOrUpdateAsync(resourceGroupName, rolloutName, rolloutRequest, context).getSyncPoller(); @@ -362,7 +361,7 @@ public SyncPoller, RolloutRequestInner> beginCre * @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 defines the PUT rollout request body. + * @return defines the PUT rollout request body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -381,7 +380,7 @@ private Mono createOrUpdateAsync( * @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 defines the PUT rollout request body. + * @return defines the PUT rollout request body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String resourceGroupName, String rolloutName) { @@ -402,7 +401,7 @@ private Mono createOrUpdateAsync(String resourceGroupName, * @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 defines the PUT rollout request body. + * @return defines the PUT rollout request body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -476,7 +475,7 @@ public RolloutRequestInner createOrUpdate( * @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 detailed information of a rollout. + * @return detailed information of a rollout along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -528,7 +527,7 @@ private Mono> getByResourceGroupWithResponseAsync( * @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 detailed information of a rollout. + * @return detailed information of a rollout along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -576,20 +575,13 @@ private Mono> getByResourceGroupWithResponseAsync( * @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 detailed information of a rollout. + * @return detailed information of a rollout on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByResourceGroupAsync( String resourceGroupName, String rolloutName, Integer retryAttempt) { return getByResourceGroupWithResponseAsync(resourceGroupName, rolloutName, retryAttempt) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -600,20 +592,13 @@ private Mono getByResourceGroupAsync( * @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 detailed information of a rollout. + * @return detailed information of a rollout on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByResourceGroupAsync(String resourceGroupName, String rolloutName) { final Integer retryAttempt = null; return getByResourceGroupWithResponseAsync(resourceGroupName, rolloutName, retryAttempt) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -643,7 +628,7 @@ public RolloutInner getByResourceGroup(String resourceGroupName, String rolloutN * @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 detailed information of a rollout. + * @return detailed information of a rollout along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse( @@ -659,7 +644,7 @@ public Response getByResourceGroupWithResponse( * @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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync(String resourceGroupName, String rolloutName) { @@ -707,7 +692,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * @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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync( @@ -752,11 +737,11 @@ private Mono> deleteWithResponseAsync( * @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 completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String rolloutName) { - return deleteWithResponseAsync(resourceGroupName, rolloutName).flatMap((Response res) -> Mono.empty()); + return deleteWithResponseAsync(resourceGroupName, rolloutName).flatMap(ignored -> Mono.empty()); } /** @@ -782,7 +767,7 @@ public void delete(String resourceGroupName, String rolloutName) { * @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. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(String resourceGroupName, String rolloutName, Context context) { @@ -797,7 +782,7 @@ public Response deleteWithResponse(String resourceGroupName, String rollou * @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 defines the rollout. + * @return defines the rollout along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> cancelWithResponseAsync(String resourceGroupName, String rolloutName) { @@ -845,7 +830,7 @@ private Mono> cancelWithResponseAsync(String resourceGrou * @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 defines the rollout. + * @return defines the rollout along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> cancelWithResponseAsync( @@ -890,19 +875,11 @@ private Mono> cancelWithResponseAsync( * @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 defines the rollout. + * @return defines the rollout on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono cancelAsync(String resourceGroupName, String rolloutName) { - return cancelWithResponseAsync(resourceGroupName, rolloutName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + return cancelWithResponseAsync(resourceGroupName, rolloutName).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -929,7 +906,7 @@ public RolloutInner cancel(String resourceGroupName, String rolloutName) { * @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 defines the rollout. + * @return defines the rollout along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response cancelWithResponse(String resourceGroupName, String rolloutName, Context context) { @@ -947,7 +924,7 @@ public Response cancelWithResponse(String resourceGroupName, Strin * @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 defines the rollout. + * @return defines the rollout along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> restartWithResponseAsync( @@ -1000,7 +977,7 @@ private Mono> restartWithResponseAsync( * @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 defines the rollout. + * @return defines the rollout along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> restartWithResponseAsync( @@ -1049,19 +1026,12 @@ private Mono> restartWithResponseAsync( * @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 defines the rollout. + * @return defines the rollout on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono restartAsync(String resourceGroupName, String rolloutName, Boolean skipSucceeded) { return restartWithResponseAsync(resourceGroupName, rolloutName, skipSucceeded) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -1072,20 +1042,13 @@ private Mono restartAsync(String resourceGroupName, String rollout * @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 defines the rollout. + * @return defines the rollout on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono restartAsync(String resourceGroupName, String rolloutName) { final Boolean skipSucceeded = null; return restartWithResponseAsync(resourceGroupName, rolloutName, skipSucceeded) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -1116,7 +1079,7 @@ public RolloutInner restart(String resourceGroupName, String rolloutName) { * @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 defines the rollout. + * @return defines the rollout along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response restartWithResponse( @@ -1131,7 +1094,7 @@ public Response restartWithResponse( * @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 list of rollouts. + * @return the list of rollouts along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> listWithResponseAsync(String resourceGroupName) { @@ -1174,7 +1137,7 @@ private Mono>> listWithResponseAsync(String 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 list of rollouts. + * @return the list of rollouts along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> listWithResponseAsync(String resourceGroupName, Context context) { @@ -1213,19 +1176,11 @@ private Mono>> listWithResponseAsync(String 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 list of rollouts. + * @return the list of rollouts on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listAsync(String resourceGroupName) { - return listWithResponseAsync(resourceGroupName) - .flatMap( - (Response> res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + return listWithResponseAsync(resourceGroupName).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -1250,7 +1205,7 @@ public List list(String resourceGroupName) { * @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 list of rollouts. + * @return the list of rollouts along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response> listWithResponse(String resourceGroupName, Context context) { diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/RolloutsImpl.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/RolloutsImpl.java index f9a3262c68c8a..7cfe0ac968136 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/RolloutsImpl.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/RolloutsImpl.java @@ -12,13 +12,12 @@ import com.azure.resourcemanager.deploymentmanager.fluent.models.RolloutInner; import com.azure.resourcemanager.deploymentmanager.models.Rollout; import com.azure.resourcemanager.deploymentmanager.models.Rollouts; -import com.fasterxml.jackson.annotation.JsonIgnore; import java.util.Collections; import java.util.List; import java.util.stream.Collectors; public final class RolloutsImpl implements Rollouts { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RolloutsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(RolloutsImpl.class); private final RolloutsClient innerClient; @@ -139,7 +138,7 @@ public Response> listWithResponse(String resourceGroupName, Contex public void deleteById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -147,18 +146,18 @@ public void deleteById(String id) { } String rolloutName = Utils.getValueFromIdByName(id, "rollouts"); if (rolloutName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'rollouts'.", id))); } - this.deleteWithResponse(resourceGroupName, rolloutName, Context.NONE).getValue(); + this.deleteWithResponse(resourceGroupName, rolloutName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -166,7 +165,7 @@ public Response deleteByIdWithResponse(String id, Context context) { } String rolloutName = Utils.getValueFromIdByName(id, "rollouts"); if (rolloutName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'rollouts'.", id))); diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/ServiceResourceImpl.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/ServiceResourceImpl.java index 4f70defa27002..37362a6af2b19 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/ServiceResourceImpl.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/ServiceResourceImpl.java @@ -41,14 +41,6 @@ public Map tags() { } } - public String targetLocation() { - return this.innerModel().targetLocation(); - } - - public String targetSubscriptionId() { - return this.innerModel().targetSubscriptionId(); - } - public Region region() { return Region.fromName(this.regionName()); } @@ -57,6 +49,10 @@ public String regionName() { return this.location(); } + public String resourceGroupName() { + return resourceGroupName; + } + public ServiceResourceInner innerModel() { return this.innerObject; } @@ -171,16 +167,6 @@ public ServiceResourceImpl withRegion(String location) { return this; } - public ServiceResourceImpl withTargetLocation(String targetLocation) { - this.innerModel().withTargetLocation(targetLocation); - return this; - } - - public ServiceResourceImpl withTargetSubscriptionId(String targetSubscriptionId) { - this.innerModel().withTargetSubscriptionId(targetSubscriptionId); - return this; - } - public ServiceResourceImpl withTags(Map tags) { this.innerModel().withTags(tags); return this; diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/ServiceTopologiesClientImpl.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/ServiceTopologiesClientImpl.java index 7e6997261bbf5..5b0a8da2b1c76 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/ServiceTopologiesClientImpl.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/ServiceTopologiesClientImpl.java @@ -24,7 +24,6 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.deploymentmanager.fluent.ServiceTopologiesClient; import com.azure.resourcemanager.deploymentmanager.fluent.models.ServiceTopologyResourceInner; import java.util.List; @@ -32,8 +31,6 @@ /** An instance of this class provides access to all the operations defined in ServiceTopologiesClient. */ public final class ServiceTopologiesClientImpl implements ServiceTopologiesClient { - private final ClientLogger logger = new ClientLogger(ServiceTopologiesClientImpl.class); - /** The proxy service used to perform REST calls. */ private final ServiceTopologiesService service; @@ -128,7 +125,8 @@ Mono>> list( * @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 resource representation of a service topology. + * @return the resource representation of a service topology along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -186,7 +184,8 @@ private Mono> createOrUpdateWithResponseA * @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 resource representation of a service topology. + * @return the resource representation of a service topology along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -243,20 +242,13 @@ private Mono> createOrUpdateWithResponseA * @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 resource representation of a service topology. + * @return the resource representation of a service topology on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( String resourceGroupName, String serviceTopologyName, ServiceTopologyResourceInner serviceTopologyInfo) { return createOrUpdateWithResponseAsync(resourceGroupName, serviceTopologyName, serviceTopologyInfo) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -286,7 +278,7 @@ public ServiceTopologyResourceInner createOrUpdate( * @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 resource representation of a service topology. + * @return the resource representation of a service topology along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse( @@ -306,7 +298,7 @@ public Response createOrUpdateWithResponse( * @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 service topology. + * @return the service topology along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -356,7 +348,7 @@ private Mono> getByResourceGroupWithRespo * @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 service topology. + * @return the service topology along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -402,20 +394,13 @@ private Mono> getByResourceGroupWithRespo * @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 service topology. + * @return the service topology on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByResourceGroupAsync( String resourceGroupName, String serviceTopologyName) { return getByResourceGroupWithResponseAsync(resourceGroupName, serviceTopologyName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -442,7 +427,7 @@ public ServiceTopologyResourceInner getByResourceGroup(String resourceGroupName, * @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 service topology. + * @return the service topology along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse( @@ -458,7 +443,7 @@ public Response getByResourceGroupWithResponse( * @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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync(String resourceGroupName, String serviceTopologyName) { @@ -507,7 +492,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * @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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync( @@ -553,12 +538,11 @@ private Mono> deleteWithResponseAsync( * @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 completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String serviceTopologyName) { - return deleteWithResponseAsync(resourceGroupName, serviceTopologyName) - .flatMap((Response res) -> Mono.empty()); + return deleteWithResponseAsync(resourceGroupName, serviceTopologyName).flatMap(ignored -> Mono.empty()); } /** @@ -584,7 +568,7 @@ public void delete(String resourceGroupName, String serviceTopologyName) { * @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. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(String resourceGroupName, String serviceTopologyName, Context context) { @@ -598,7 +582,7 @@ public Response deleteWithResponse(String resourceGroupName, String servic * @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 list of service topologies. + * @return the list of service topologies along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> listWithResponseAsync(String resourceGroupName) { @@ -641,7 +625,7 @@ private Mono>> listWithResponseAsync * @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 list of service topologies. + * @return the list of service topologies along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> listWithResponseAsync( @@ -681,19 +665,11 @@ private Mono>> listWithResponseAsync * @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 list of service topologies. + * @return the list of service topologies on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listAsync(String resourceGroupName) { - return listWithResponseAsync(resourceGroupName) - .flatMap( - (Response> res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + return listWithResponseAsync(resourceGroupName).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -718,7 +694,7 @@ public List list(String resourceGroupName) { * @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 list of service topologies. + * @return the list of service topologies along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response> listWithResponse(String resourceGroupName, Context context) { diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/ServiceTopologiesImpl.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/ServiceTopologiesImpl.java index 542858647aa09..c8767f4757144 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/ServiceTopologiesImpl.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/ServiceTopologiesImpl.java @@ -12,13 +12,12 @@ import com.azure.resourcemanager.deploymentmanager.fluent.models.ServiceTopologyResourceInner; import com.azure.resourcemanager.deploymentmanager.models.ServiceTopologies; import com.azure.resourcemanager.deploymentmanager.models.ServiceTopologyResource; -import com.fasterxml.jackson.annotation.JsonIgnore; import java.util.Collections; import java.util.List; import java.util.stream.Collectors; public final class ServiceTopologiesImpl implements ServiceTopologies { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceTopologiesImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(ServiceTopologiesImpl.class); private final ServiceTopologiesClient innerClient; @@ -99,7 +98,7 @@ public Response> listWithResponse(String resourceG public ServiceTopologyResource getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -107,7 +106,7 @@ public ServiceTopologyResource getById(String id) { } String serviceTopologyName = Utils.getValueFromIdByName(id, "serviceTopologies"); if (serviceTopologyName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -120,7 +119,7 @@ public ServiceTopologyResource getById(String id) { public Response getByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -128,7 +127,7 @@ public Response getByIdWithResponse(String id, Context } String serviceTopologyName = Utils.getValueFromIdByName(id, "serviceTopologies"); if (serviceTopologyName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -141,7 +140,7 @@ public Response getByIdWithResponse(String id, Context public void deleteById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -149,20 +148,20 @@ public void deleteById(String id) { } String serviceTopologyName = Utils.getValueFromIdByName(id, "serviceTopologies"); if (serviceTopologyName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String .format( "The resource ID '%s' is not valid. Missing path segment 'serviceTopologies'.", id))); } - this.deleteWithResponse(resourceGroupName, serviceTopologyName, Context.NONE).getValue(); + this.deleteWithResponse(resourceGroupName, serviceTopologyName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -170,7 +169,7 @@ public Response deleteByIdWithResponse(String id, Context context) { } String serviceTopologyName = Utils.getValueFromIdByName(id, "serviceTopologies"); if (serviceTopologyName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/ServiceTopologyResourceImpl.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/ServiceTopologyResourceImpl.java index bd6965b1127ac..9fe19873bcbd2 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/ServiceTopologyResourceImpl.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/ServiceTopologyResourceImpl.java @@ -42,10 +42,6 @@ public Map tags() { } } - public String artifactSourceId() { - return this.innerModel().artifactSourceId(); - } - public Region region() { return Region.fromName(this.regionName()); } @@ -54,6 +50,10 @@ public String regionName() { return this.location(); } + public String resourceGroupName() { + return resourceGroupName; + } + public ServiceTopologyResourceInner innerModel() { return this.innerObject; } @@ -165,9 +165,4 @@ public ServiceTopologyResourceImpl withTags(Map tags) { this.innerModel().withTags(tags); return this; } - - public ServiceTopologyResourceImpl withArtifactSourceId(String artifactSourceId) { - this.innerModel().withArtifactSourceId(artifactSourceId); - return this; - } } diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/ServiceUnitResourceImpl.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/ServiceUnitResourceImpl.java index 86d869e41ddae..48c9835161675 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/ServiceUnitResourceImpl.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/ServiceUnitResourceImpl.java @@ -7,8 +7,6 @@ import com.azure.core.management.Region; import com.azure.core.util.Context; import com.azure.resourcemanager.deploymentmanager.fluent.models.ServiceUnitResourceInner; -import com.azure.resourcemanager.deploymentmanager.models.DeploymentMode; -import com.azure.resourcemanager.deploymentmanager.models.ServiceUnitArtifacts; import com.azure.resourcemanager.deploymentmanager.models.ServiceUnitResource; import java.util.Collections; import java.util.Map; @@ -44,18 +42,6 @@ public Map tags() { } } - public String targetResourceGroup() { - return this.innerModel().targetResourceGroup(); - } - - public DeploymentMode deploymentMode() { - return this.innerModel().deploymentMode(); - } - - public ServiceUnitArtifacts artifacts() { - return this.innerModel().artifacts(); - } - public Region region() { return Region.fromName(this.regionName()); } @@ -64,6 +50,10 @@ public String regionName() { return this.location(); } + public String resourceGroupName() { + return resourceGroupName; + } + public ServiceUnitResourceInner innerModel() { return this.innerObject; } @@ -189,23 +179,8 @@ public ServiceUnitResourceImpl withRegion(String location) { return this; } - public ServiceUnitResourceImpl withTargetResourceGroup(String targetResourceGroup) { - this.innerModel().withTargetResourceGroup(targetResourceGroup); - return this; - } - - public ServiceUnitResourceImpl withDeploymentMode(DeploymentMode deploymentMode) { - this.innerModel().withDeploymentMode(deploymentMode); - return this; - } - public ServiceUnitResourceImpl withTags(Map tags) { this.innerModel().withTags(tags); return this; } - - public ServiceUnitResourceImpl withArtifacts(ServiceUnitArtifacts artifacts) { - this.innerModel().withArtifacts(artifacts); - return this; - } } diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/ServiceUnitsClientImpl.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/ServiceUnitsClientImpl.java index bec24b5cf181f..509eb2dd7c001 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/ServiceUnitsClientImpl.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/ServiceUnitsClientImpl.java @@ -25,7 +25,6 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.deploymentmanager.fluent.ServiceUnitsClient; @@ -37,8 +36,6 @@ /** An instance of this class provides access to all the operations defined in ServiceUnitsClient. */ public final class ServiceUnitsClientImpl implements ServiceUnitsClient { - private final ClientLogger logger = new ClientLogger(ServiceUnitsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final ServiceUnitsService service; @@ -144,7 +141,8 @@ Mono>> list( * @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 represents the response of a service unit resource. + * @return represents the response of a service unit resource along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( @@ -218,7 +216,8 @@ 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 represents the response of a service unit resource. + * @return represents the response of a service unit resource along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( @@ -289,9 +288,9 @@ 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 represents the response of a service unit resource. + * @return the {@link PollerFlux} for polling of represents the response of a service unit resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ServiceUnitResourceInner> beginCreateOrUpdateAsync( String resourceGroupName, String serviceTopologyName, @@ -308,7 +307,7 @@ private PollerFlux, ServiceUnitResourceInne this.client.getHttpPipeline(), ServiceUnitResourceInner.class, ServiceUnitResourceInner.class, - Context.NONE); + this.client.getContext()); } /** @@ -324,9 +323,9 @@ private PollerFlux, ServiceUnitResourceInne * @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 represents the response of a service unit resource. + * @return the {@link PollerFlux} for polling of represents the response of a service unit resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ServiceUnitResourceInner> beginCreateOrUpdateAsync( String resourceGroupName, String serviceTopologyName, @@ -360,9 +359,9 @@ private PollerFlux, ServiceUnitResourceInne * @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 represents the response of a service unit resource. + * @return the {@link SyncPoller} for polling of represents the response of a service unit resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ServiceUnitResourceInner> beginCreateOrUpdate( String resourceGroupName, String serviceTopologyName, @@ -387,9 +386,9 @@ public SyncPoller, ServiceUnitResourceInner * @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 represents the response of a service unit resource. + * @return the {@link SyncPoller} for polling of represents the response of a service unit resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ServiceUnitResourceInner> beginCreateOrUpdate( String resourceGroupName, String serviceTopologyName, @@ -414,7 +413,7 @@ public SyncPoller, ServiceUnitResourceInner * @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 represents the response of a service unit resource. + * @return represents the response of a service unit resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -442,7 +441,7 @@ private Mono createOrUpdateAsync( * @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 represents the response of a service unit resource. + * @return represents the response of a service unit resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -522,7 +521,7 @@ public ServiceUnitResourceInner createOrUpdate( * @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 service unit. + * @return the service unit along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -583,7 +582,7 @@ private Mono> getWithResponseAsync( * @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 service unit. + * @return the service unit along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -644,20 +643,13 @@ private Mono> getWithResponseAsync( * @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 service unit. + * @return the service unit on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync( String resourceGroupName, String serviceTopologyName, String serviceName, String serviceUnitName) { return getWithResponseAsync(resourceGroupName, serviceTopologyName, serviceName, serviceUnitName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -689,7 +681,7 @@ public ServiceUnitResourceInner get( * @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 service unit. + * @return the service unit along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse( @@ -712,7 +704,7 @@ public Response getWithResponse( * @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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync( @@ -773,7 +765,7 @@ private Mono> deleteWithResponseAsync( * @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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync( @@ -834,13 +826,13 @@ private Mono> deleteWithResponseAsync( * @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 completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync( String resourceGroupName, String serviceTopologyName, String serviceName, String serviceUnitName) { return deleteWithResponseAsync(resourceGroupName, serviceTopologyName, serviceName, serviceUnitName) - .flatMap((Response res) -> Mono.empty()); + .flatMap(ignored -> Mono.empty()); } /** @@ -871,7 +863,7 @@ public void delete( * @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. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse( @@ -893,7 +885,7 @@ public Response deleteWithResponse( * @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 list of service units. + * @return the list of service units along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> listWithResponseAsync( @@ -948,7 +940,7 @@ private Mono>> listWithResponseAsync( * @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 list of service units. + * @return the list of service units along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> listWithResponseAsync( @@ -999,20 +991,13 @@ private Mono>> listWithResponseAsync( * @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 list of service units. + * @return the list of service units on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listAsync( String resourceGroupName, String serviceTopologyName, String serviceName) { return listWithResponseAsync(resourceGroupName, serviceTopologyName, serviceName) - .flatMap( - (Response> res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -1042,7 +1027,7 @@ public List list( * @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 list of service units. + * @return the list of service units along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response> listWithResponse( diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/ServiceUnitsImpl.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/ServiceUnitsImpl.java index f7edf2376e5b4..1b155fb6317c0 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/ServiceUnitsImpl.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/ServiceUnitsImpl.java @@ -12,13 +12,12 @@ import com.azure.resourcemanager.deploymentmanager.fluent.models.ServiceUnitResourceInner; import com.azure.resourcemanager.deploymentmanager.models.ServiceUnitResource; import com.azure.resourcemanager.deploymentmanager.models.ServiceUnits; -import com.fasterxml.jackson.annotation.JsonIgnore; import java.util.Collections; import java.util.List; import java.util.stream.Collectors; public final class ServiceUnitsImpl implements ServiceUnits { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceUnitsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(ServiceUnitsImpl.class); private final ServiceUnitsClient innerClient; @@ -115,7 +114,7 @@ public Response> listWithResponse( public ServiceUnitResource getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -123,7 +122,7 @@ public ServiceUnitResource getById(String id) { } String serviceTopologyName = Utils.getValueFromIdByName(id, "serviceTopologies"); if (serviceTopologyName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -132,14 +131,14 @@ public ServiceUnitResource getById(String id) { } String serviceName = Utils.getValueFromIdByName(id, "services"); if (serviceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id))); } String serviceUnitName = Utils.getValueFromIdByName(id, "serviceUnits"); if (serviceUnitName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'serviceUnits'.", id))); @@ -152,7 +151,7 @@ public ServiceUnitResource getById(String id) { public Response getByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -160,7 +159,7 @@ public Response getByIdWithResponse(String id, Context cont } String serviceTopologyName = Utils.getValueFromIdByName(id, "serviceTopologies"); if (serviceTopologyName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -169,14 +168,14 @@ public Response getByIdWithResponse(String id, Context cont } String serviceName = Utils.getValueFromIdByName(id, "services"); if (serviceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id))); } String serviceUnitName = Utils.getValueFromIdByName(id, "serviceUnits"); if (serviceUnitName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'serviceUnits'.", id))); @@ -187,7 +186,7 @@ public Response getByIdWithResponse(String id, Context cont public void deleteById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -195,7 +194,7 @@ public void deleteById(String id) { } String serviceTopologyName = Utils.getValueFromIdByName(id, "serviceTopologies"); if (serviceTopologyName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -204,27 +203,25 @@ public void deleteById(String id) { } String serviceName = Utils.getValueFromIdByName(id, "services"); if (serviceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id))); } String serviceUnitName = Utils.getValueFromIdByName(id, "serviceUnits"); if (serviceUnitName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'serviceUnits'.", id))); } - this - .deleteWithResponse(resourceGroupName, serviceTopologyName, serviceName, serviceUnitName, Context.NONE) - .getValue(); + this.deleteWithResponse(resourceGroupName, serviceTopologyName, serviceName, serviceUnitName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -232,7 +229,7 @@ public Response deleteByIdWithResponse(String id, Context context) { } String serviceTopologyName = Utils.getValueFromIdByName(id, "serviceTopologies"); if (serviceTopologyName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -241,14 +238,14 @@ public Response deleteByIdWithResponse(String id, Context context) { } String serviceName = Utils.getValueFromIdByName(id, "services"); if (serviceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id))); } String serviceUnitName = Utils.getValueFromIdByName(id, "serviceUnits"); if (serviceUnitName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'serviceUnits'.", id))); diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/ServicesClientImpl.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/ServicesClientImpl.java index 3d7fbd7088110..d65114e421f2d 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/ServicesClientImpl.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/ServicesClientImpl.java @@ -24,7 +24,6 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.deploymentmanager.fluent.ServicesClient; import com.azure.resourcemanager.deploymentmanager.fluent.models.ServiceResourceInner; import java.util.List; @@ -32,8 +31,6 @@ /** An instance of this class provides access to all the operations defined in ServicesClient. */ public final class ServicesClientImpl implements ServicesClient { - private final ClientLogger logger = new ClientLogger(ServicesClientImpl.class); - /** The proxy service used to perform REST calls. */ private final ServicesService service; @@ -132,7 +129,8 @@ Mono>> list( * @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 resource representation of a service in a service topology. + * @return the resource representation of a service in a service topology along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -194,7 +192,8 @@ 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 the resource representation of a service in a service topology. + * @return the resource representation of a service in a service topology along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -256,20 +255,13 @@ 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 the resource representation of a service in a service topology. + * @return the resource representation of a service in a service topology on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( String resourceGroupName, String serviceTopologyName, String serviceName, ServiceResourceInner serviceInfo) { return createOrUpdateWithResponseAsync(resourceGroupName, serviceTopologyName, serviceName, serviceInfo) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -301,7 +293,7 @@ public ServiceResourceInner createOrUpdate( * @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 resource representation of a service in a service topology. + * @return the resource representation of a service in a service topology along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse( @@ -324,7 +316,7 @@ public Response createOrUpdateWithResponse( * @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 service. + * @return the service along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -379,7 +371,7 @@ private Mono> getWithResponseAsync( * @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 service. + * @return the service along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -430,20 +422,13 @@ private Mono> getWithResponseAsync( * @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 service. + * @return the service on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync( String resourceGroupName, String serviceTopologyName, String serviceName) { return getWithResponseAsync(resourceGroupName, serviceTopologyName, serviceName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -472,7 +457,7 @@ public ServiceResourceInner get(String resourceGroupName, String serviceTopology * @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 service. + * @return the service along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse( @@ -489,7 +474,7 @@ public Response getWithResponse( * @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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync( @@ -544,7 +529,7 @@ private Mono> deleteWithResponseAsync( * @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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync( @@ -595,12 +580,12 @@ private Mono> deleteWithResponseAsync( * @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 completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String serviceTopologyName, String serviceName) { return deleteWithResponseAsync(resourceGroupName, serviceTopologyName, serviceName) - .flatMap((Response res) -> Mono.empty()); + .flatMap(ignored -> Mono.empty()); } /** @@ -628,7 +613,7 @@ public void delete(String resourceGroupName, String serviceTopologyName, String * @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. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse( @@ -644,7 +629,7 @@ public Response deleteWithResponse( * @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 list of services. + * @return the list of services along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> listWithResponseAsync( @@ -694,7 +679,7 @@ private Mono>> listWithResponseAsync( * @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 list of services. + * @return the list of services along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> listWithResponseAsync( @@ -740,19 +725,12 @@ private Mono>> listWithResponseAsync( * @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 list of services. + * @return the list of services on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listAsync(String resourceGroupName, String serviceTopologyName) { return listWithResponseAsync(resourceGroupName, serviceTopologyName) - .flatMap( - (Response> res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -779,7 +757,7 @@ public List list(String resourceGroupName, String serviceT * @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 list of services. + * @return the list of services along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response> listWithResponse( diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/ServicesImpl.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/ServicesImpl.java index c4881bf7986b5..88e8ff761c1fe 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/ServicesImpl.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/ServicesImpl.java @@ -12,13 +12,12 @@ import com.azure.resourcemanager.deploymentmanager.fluent.models.ServiceResourceInner; import com.azure.resourcemanager.deploymentmanager.models.ServiceResource; import com.azure.resourcemanager.deploymentmanager.models.Services; -import com.fasterxml.jackson.annotation.JsonIgnore; import java.util.Collections; import java.util.List; import java.util.stream.Collectors; public final class ServicesImpl implements Services { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServicesImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(ServicesImpl.class); private final ServicesClient innerClient; @@ -99,7 +98,7 @@ public Response> listWithResponse( public ServiceResource getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -107,7 +106,7 @@ public ServiceResource getById(String id) { } String serviceTopologyName = Utils.getValueFromIdByName(id, "serviceTopologies"); if (serviceTopologyName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -116,7 +115,7 @@ public ServiceResource getById(String id) { } String serviceName = Utils.getValueFromIdByName(id, "services"); if (serviceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id))); @@ -127,7 +126,7 @@ public ServiceResource getById(String id) { public Response getByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -135,7 +134,7 @@ public Response getByIdWithResponse(String id, Context context) } String serviceTopologyName = Utils.getValueFromIdByName(id, "serviceTopologies"); if (serviceTopologyName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -144,7 +143,7 @@ public Response getByIdWithResponse(String id, Context context) } String serviceName = Utils.getValueFromIdByName(id, "services"); if (serviceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id))); @@ -155,7 +154,7 @@ public Response getByIdWithResponse(String id, Context context) public void deleteById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -163,7 +162,7 @@ public void deleteById(String id) { } String serviceTopologyName = Utils.getValueFromIdByName(id, "serviceTopologies"); if (serviceTopologyName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -172,18 +171,18 @@ public void deleteById(String id) { } String serviceName = Utils.getValueFromIdByName(id, "services"); if (serviceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id))); } - this.deleteWithResponse(resourceGroupName, serviceTopologyName, serviceName, Context.NONE).getValue(); + this.deleteWithResponse(resourceGroupName, serviceTopologyName, serviceName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -191,7 +190,7 @@ public Response deleteByIdWithResponse(String id, Context context) { } String serviceTopologyName = Utils.getValueFromIdByName(id, "serviceTopologies"); if (serviceTopologyName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -200,7 +199,7 @@ public Response deleteByIdWithResponse(String id, Context context) { } String serviceName = Utils.getValueFromIdByName(id, "services"); if (serviceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id))); diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/StepResourceImpl.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/StepResourceImpl.java index 0673750ca5934..17a6165c35843 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/StepResourceImpl.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/StepResourceImpl.java @@ -54,6 +54,10 @@ public String regionName() { return this.location(); } + public String resourceGroupName() { + return resourceGroupName; + } + public StepResourceInner innerModel() { return this.innerObject; } diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/StepsClientImpl.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/StepsClientImpl.java index b0398525b9bce..582997ace5907 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/StepsClientImpl.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/StepsClientImpl.java @@ -24,7 +24,6 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.deploymentmanager.fluent.StepsClient; import com.azure.resourcemanager.deploymentmanager.fluent.models.StepResourceInner; import java.util.List; @@ -32,8 +31,6 @@ /** An instance of this class provides access to all the operations defined in StepsClient. */ public final class StepsClientImpl implements StepsClient { - private final ClientLogger logger = new ClientLogger(StepsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final StepsService service; @@ -127,7 +124,8 @@ Mono>> list( * @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 resource representation of a rollout step. + * @return the resource representation of a rollout step along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -181,7 +179,8 @@ 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 the resource representation of a rollout step. + * @return the resource representation of a rollout step along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -231,20 +230,13 @@ 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 the resource representation of a rollout step. + * @return the resource representation of a rollout step on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( String resourceGroupName, String stepName, StepResourceInner stepInfo) { return createOrUpdateWithResponseAsync(resourceGroupName, stepName, stepInfo) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -255,20 +247,13 @@ private Mono createOrUpdateAsync( * @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 resource representation of a rollout step. + * @return the resource representation of a rollout step on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String resourceGroupName, String stepName) { final StepResourceInner stepInfo = null; return createOrUpdateWithResponseAsync(resourceGroupName, stepName, stepInfo) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -297,7 +282,7 @@ public StepResourceInner createOrUpdate(String resourceGroupName, String stepNam * @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 resource representation of a rollout step. + * @return the resource representation of a rollout step along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse( @@ -313,7 +298,7 @@ public Response createOrUpdateWithResponse( * @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 step. + * @return the step along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -362,7 +347,7 @@ private Mono> getByResourceGroupWithResponseAsync( * @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 step. + * @return the step along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -407,19 +392,12 @@ private Mono> getByResourceGroupWithResponseAsync( * @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 step. + * @return the step on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByResourceGroupAsync(String resourceGroupName, String stepName) { return getByResourceGroupWithResponseAsync(resourceGroupName, stepName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -446,7 +424,7 @@ public StepResourceInner getByResourceGroup(String resourceGroupName, String ste * @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 step. + * @return the step along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse( @@ -462,7 +440,7 @@ public Response getByResourceGroupWithResponse( * @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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync(String resourceGroupName, String stepName) { @@ -510,7 +488,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * @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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync(String resourceGroupName, String stepName, Context context) { @@ -554,11 +532,11 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * @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 completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String stepName) { - return deleteWithResponseAsync(resourceGroupName, stepName).flatMap((Response res) -> Mono.empty()); + return deleteWithResponseAsync(resourceGroupName, stepName).flatMap(ignored -> Mono.empty()); } /** @@ -584,7 +562,7 @@ public void delete(String resourceGroupName, String stepName) { * @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. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(String resourceGroupName, String stepName, Context context) { @@ -598,7 +576,7 @@ public Response deleteWithResponse(String resourceGroupName, String stepNa * @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 list of steps. + * @return the list of steps along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> listWithResponseAsync(String resourceGroupName) { @@ -641,7 +619,7 @@ private Mono>> listWithResponseAsync(String res * @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 list of steps. + * @return the list of steps along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> listWithResponseAsync(String resourceGroupName, Context context) { @@ -680,19 +658,11 @@ private Mono>> listWithResponseAsync(String res * @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 list of steps. + * @return the list of steps on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listAsync(String resourceGroupName) { - return listWithResponseAsync(resourceGroupName) - .flatMap( - (Response> res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + return listWithResponseAsync(resourceGroupName).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -717,7 +687,7 @@ public List list(String resourceGroupName) { * @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 list of steps. + * @return the list of steps along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response> listWithResponse(String resourceGroupName, Context context) { diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/StepsImpl.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/StepsImpl.java index 3320b4c5a951e..3d4642cbb036a 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/StepsImpl.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/StepsImpl.java @@ -12,13 +12,12 @@ import com.azure.resourcemanager.deploymentmanager.fluent.models.StepResourceInner; import com.azure.resourcemanager.deploymentmanager.models.StepResource; import com.azure.resourcemanager.deploymentmanager.models.Steps; -import com.fasterxml.jackson.annotation.JsonIgnore; import java.util.Collections; import java.util.List; import java.util.stream.Collectors; public final class StepsImpl implements Steps { - @JsonIgnore private final ClientLogger logger = new ClientLogger(StepsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(StepsImpl.class); private final StepsClient innerClient; @@ -96,7 +95,7 @@ public Response> listWithResponse(String resourceGroupName, C public StepResource getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -104,7 +103,7 @@ public StepResource getById(String id) { } String stepName = Utils.getValueFromIdByName(id, "steps"); if (stepName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'steps'.", id))); @@ -115,7 +114,7 @@ public StepResource getById(String id) { public Response getByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -123,7 +122,7 @@ public Response getByIdWithResponse(String id, Context context) { } String stepName = Utils.getValueFromIdByName(id, "steps"); if (stepName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'steps'.", id))); @@ -134,7 +133,7 @@ public Response getByIdWithResponse(String id, Context context) { public void deleteById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -142,18 +141,18 @@ public void deleteById(String id) { } String stepName = Utils.getValueFromIdByName(id, "steps"); if (stepName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'steps'.", id))); } - this.deleteWithResponse(resourceGroupName, stepName, Context.NONE).getValue(); + this.deleteWithResponse(resourceGroupName, stepName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -161,7 +160,7 @@ public Response deleteByIdWithResponse(String id, Context context) { } String stepName = Utils.getValueFromIdByName(id, "steps"); if (stepName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'steps'.", id))); diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/package-info.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/package-info.java index fcecd3f9c3fbe..a3e88bd1fcbe8 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/package-info.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/implementation/package-info.java @@ -5,6 +5,6 @@ /** * Package containing the implementations for AzureDeploymentManager. REST APIs for orchestrating deployments using the * Azure Deployment Manager (ADM). See - * https://docs.microsoft.com/azure/azure-resource-manager/deployment-manager-overview for more information. + * https://docs.microsoft.com/en-us/azure/azure-resource-manager/deployment-manager-overview for more information. */ package com.azure.resourcemanager.deploymentmanager.implementation; diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ApiKeyAuthentication.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ApiKeyAuthentication.java index e794f2acaa1ae..375b453047b54 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ApiKeyAuthentication.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ApiKeyAuthentication.java @@ -6,7 +6,6 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -18,8 +17,6 @@ @JsonTypeName("ApiKey") @Fluent public final class ApiKeyAuthentication extends RestRequestAuthentication { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiKeyAuthentication.class); - /* * The key name of the authentication key/value pair. */ @@ -107,19 +104,21 @@ public ApiKeyAuthentication withValue(String value) { public void validate() { super.validate(); if (name() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property name in model ApiKeyAuthentication")); } if (in() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property in in model ApiKeyAuthentication")); } if (value() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property value in model ApiKeyAuthentication")); } } + + private static final ClientLogger LOGGER = new ClientLogger(ApiKeyAuthentication.class); } diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ArtifactSource.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ArtifactSource.java index 614410889234f..c6160b268005f 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ArtifactSource.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ArtifactSource.java @@ -46,31 +46,6 @@ public interface ArtifactSource { */ Map tags(); - /** - * Gets the sourceType property: The type of artifact source used. - * - * @return the sourceType value. - */ - String sourceType(); - - /** - * Gets the artifactRoot property: The path from the location that the 'authentication' property [say, a SAS URI to - * the blob container] refers to, to the location of the artifacts. This can be used to differentiate different - * versions of the artifacts. Or, different types of artifacts like binaries or templates. The location referenced - * by the authentication property concatenated with this optional artifactRoot path forms the artifact source - * location where the artifacts are expected to be found. - * - * @return the artifactRoot value. - */ - String artifactRoot(); - - /** - * Gets the authentication property: The authentication method to use to access the artifact source. - * - * @return the authentication value. - */ - Authentication authentication(); - /** * Gets the region of the resource. * @@ -85,6 +60,13 @@ public interface ArtifactSource { */ String regionName(); + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + /** * Gets the inner com.azure.resourcemanager.deploymentmanager.fluent.models.ArtifactSourceInner object. * @@ -136,11 +118,7 @@ interface WithResourceGroup { * The stage of the ArtifactSource 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.WithSourceType, - DefinitionStages.WithArtifactRoot, - DefinitionStages.WithAuthentication { + interface WithCreate extends DefinitionStages.WithTags { /** * Executes the create request. * @@ -166,44 +144,6 @@ interface WithTags { */ WithCreate withTags(Map tags); } - /** The stage of the ArtifactSource definition allowing to specify sourceType. */ - interface WithSourceType { - /** - * Specifies the sourceType property: The type of artifact source used.. - * - * @param sourceType The type of artifact source used. - * @return the next definition stage. - */ - WithCreate withSourceType(String sourceType); - } - /** The stage of the ArtifactSource definition allowing to specify artifactRoot. */ - interface WithArtifactRoot { - /** - * Specifies the artifactRoot property: The path from the location that the 'authentication' property [say, - * a SAS URI to the blob container] refers to, to the location of the artifacts. This can be used to - * differentiate different versions of the artifacts. Or, different types of artifacts like binaries or - * templates. The location referenced by the authentication property concatenated with this optional - * artifactRoot path forms the artifact source location where the artifacts are expected to be found.. - * - * @param artifactRoot The path from the location that the 'authentication' property [say, a SAS URI to the - * blob container] refers to, to the location of the artifacts. This can be used to differentiate - * different versions of the artifacts. Or, different types of artifacts like binaries or templates. The - * location referenced by the authentication property concatenated with this optional artifactRoot path - * forms the artifact source location where the artifacts are expected to be found. - * @return the next definition stage. - */ - WithCreate withArtifactRoot(String artifactRoot); - } - /** The stage of the ArtifactSource definition allowing to specify authentication. */ - interface WithAuthentication { - /** - * Specifies the authentication property: The authentication method to use to access the artifact source.. - * - * @param authentication The authentication method to use to access the artifact source. - * @return the next definition stage. - */ - WithCreate withAuthentication(Authentication authentication); - } } /** * Begins update for the ArtifactSource resource. @@ -213,11 +153,7 @@ interface WithAuthentication { ArtifactSource.Update update(); /** The template for ArtifactSource update. */ - interface Update - extends UpdateStages.WithTags, - UpdateStages.WithSourceType, - UpdateStages.WithArtifactRoot, - UpdateStages.WithAuthentication { + interface Update extends UpdateStages.WithTags { /** * Executes the update request. * @@ -245,44 +181,6 @@ interface WithTags { */ Update withTags(Map tags); } - /** The stage of the ArtifactSource update allowing to specify sourceType. */ - interface WithSourceType { - /** - * Specifies the sourceType property: The type of artifact source used.. - * - * @param sourceType The type of artifact source used. - * @return the next definition stage. - */ - Update withSourceType(String sourceType); - } - /** The stage of the ArtifactSource update allowing to specify artifactRoot. */ - interface WithArtifactRoot { - /** - * Specifies the artifactRoot property: The path from the location that the 'authentication' property [say, - * a SAS URI to the blob container] refers to, to the location of the artifacts. This can be used to - * differentiate different versions of the artifacts. Or, different types of artifacts like binaries or - * templates. The location referenced by the authentication property concatenated with this optional - * artifactRoot path forms the artifact source location where the artifacts are expected to be found.. - * - * @param artifactRoot The path from the location that the 'authentication' property [say, a SAS URI to the - * blob container] refers to, to the location of the artifacts. This can be used to differentiate - * different versions of the artifacts. Or, different types of artifacts like binaries or templates. The - * location referenced by the authentication property concatenated with this optional artifactRoot path - * forms the artifact source location where the artifacts are expected to be found. - * @return the next definition stage. - */ - Update withArtifactRoot(String artifactRoot); - } - /** The stage of the ArtifactSource update allowing to specify authentication. */ - interface WithAuthentication { - /** - * Specifies the authentication property: The authentication method to use to access the artifact source.. - * - * @param authentication The authentication method to use to access the artifact source. - * @return the next definition stage. - */ - Update withAuthentication(Authentication authentication); - } } /** * Refreshes the resource to sync with Azure. diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ArtifactSourcePropertiesAutoGenerated.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ArtifactSourcePropertiesAutoGenerated.java index e3b8a2f97650d..9ccad04cfcdc7 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ArtifactSourcePropertiesAutoGenerated.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ArtifactSourcePropertiesAutoGenerated.java @@ -6,14 +6,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** The properties that define the source location where the artifacts are located. */ @Fluent public class ArtifactSourcePropertiesAutoGenerated { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ArtifactSourcePropertiesAutoGenerated.class); - /* * The type of artifact source used. */ @@ -113,13 +110,13 @@ public ArtifactSourcePropertiesAutoGenerated withAuthentication(Authentication a */ public void validate() { if (sourceType() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property sourceType in model ArtifactSourcePropertiesAutoGenerated")); } if (authentication() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property authentication in model ArtifactSourcePropertiesAutoGenerated")); @@ -127,4 +124,6 @@ public void validate() { authentication().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(ArtifactSourcePropertiesAutoGenerated.class); } diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ArtifactSources.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ArtifactSources.java index 8c71d51581e81..3b11a5d8366e2 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ArtifactSources.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ArtifactSources.java @@ -31,7 +31,7 @@ public interface ArtifactSources { * @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 an artifact source. + * @return an artifact source along with {@link Response}. */ Response getByResourceGroupWithResponse( String resourceGroupName, String artifactSourceName, Context context); @@ -56,7 +56,7 @@ Response getByResourceGroupWithResponse( * @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. + * @return the {@link Response}. */ Response deleteWithResponse(String resourceGroupName, String artifactSourceName, Context context); @@ -79,7 +79,7 @@ Response getByResourceGroupWithResponse( * @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 list of artifact sources. + * @return the list of artifact sources along with {@link Response}. */ Response> listWithResponse(String resourceGroupName, Context context); @@ -90,7 +90,7 @@ Response getByResourceGroupWithResponse( * @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 an artifact source. + * @return an artifact source along with {@link Response}. */ ArtifactSource getById(String id); @@ -102,7 +102,7 @@ Response getByResourceGroupWithResponse( * @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 an artifact source. + * @return an artifact source along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); @@ -124,7 +124,7 @@ Response getByResourceGroupWithResponse( * @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. + * @return the {@link Response}. */ Response deleteByIdWithResponse(String id, Context context); diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/Authentication.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/Authentication.java index cc6a8bafd94d0..c49f385126c3c 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/Authentication.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/Authentication.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.deploymentmanager.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -21,8 +19,6 @@ @JsonSubTypes({@JsonSubTypes.Type(name = "Sas", value = SasAuthentication.class)}) @Immutable public class Authentication { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Authentication.class); - /** * Validates the instance. * diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/HealthCheckStepAttributes.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/HealthCheckStepAttributes.java index 3dc37da0fe9a9..5b700cca5e859 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/HealthCheckStepAttributes.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/HealthCheckStepAttributes.java @@ -6,7 +6,6 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -22,8 +21,6 @@ @JsonSubTypes({@JsonSubTypes.Type(name = "REST", value = RestHealthCheckStepAttributes.class)}) @Fluent public class HealthCheckStepAttributes { - @JsonIgnore private final ClientLogger logger = new ClientLogger(HealthCheckStepAttributes.class); - /* * The duration in ISO 8601 format for which health check waits idly * without any checks. @@ -125,10 +122,12 @@ public HealthCheckStepAttributes withHealthyStateDuration(String healthyStateDur */ public void validate() { if (healthyStateDuration() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property healthyStateDuration in model HealthCheckStepAttributes")); } } + + private static final ClientLogger LOGGER = new ClientLogger(HealthCheckStepAttributes.class); } diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/HealthCheckStepProperties.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/HealthCheckStepProperties.java index c39469b8ead77..42dc06b38c1a6 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/HealthCheckStepProperties.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/HealthCheckStepProperties.java @@ -6,7 +6,6 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -16,8 +15,6 @@ @JsonTypeName("HealthCheck") @Fluent public final class HealthCheckStepProperties extends StepProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(HealthCheckStepProperties.class); - /* * The health check step attributes */ @@ -53,7 +50,7 @@ public HealthCheckStepProperties withAttributes(HealthCheckStepAttributes attrib public void validate() { super.validate(); if (attributes() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property attributes in model HealthCheckStepProperties")); @@ -61,4 +58,6 @@ public void validate() { attributes().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(HealthCheckStepProperties.class); } diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/Identity.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/Identity.java index a0fcf60ea5ba1..0e992a4ca777f 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/Identity.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/Identity.java @@ -6,15 +6,12 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Identity for the resource. */ @Fluent public class Identity { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Identity.class); - /* * The identity type. */ @@ -74,13 +71,15 @@ public Identity withIdentityIds(List identityIds) { */ public void validate() { if (type() == null) { - throw logger + throw LOGGER .logExceptionAsError(new IllegalArgumentException("Missing required property type in model Identity")); } if (identityIds() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property identityIds in model Identity")); } } + + private static final ClientLogger LOGGER = new ClientLogger(Identity.class); } diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/Message.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/Message.java index 3d64f24affed3..612d40dae3c5c 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/Message.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/Message.java @@ -5,16 +5,12 @@ package com.azure.resourcemanager.deploymentmanager.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; /** Supplementary contextual messages during a rollout. */ @Immutable public final class Message { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Message.class); - /* * Time in UTC this message was provided. */ diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/Operation.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/Operation.java index 03804372deae8..b5fb0c50b1a4a 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/Operation.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/Operation.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.deploymentmanager.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Represents an operation that can be performed on the service. */ @Fluent public final class Operation { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Operation.class); - /* * The name of the operation. */ diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/OperationDetail.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/OperationDetail.java index ea361472b6aa9..a11c098fd57e3 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/OperationDetail.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/OperationDetail.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.deploymentmanager.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** The detail about an operation. */ @Fluent public final class OperationDetail { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDetail.class); - /* * The name of the provider that supports the operation. */ diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/Operations.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/Operations.java index 99aa63c197f0e..d3058bb3d6cc7 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/Operations.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/Operations.java @@ -25,7 +25,7 @@ public interface Operations { * @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 operations response. + * @return the operations response along with {@link Response}. */ Response listWithResponse(Context context); } diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/PrePostStep.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/PrePostStep.java index 88263b297c494..475253becf795 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/PrePostStep.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/PrePostStep.java @@ -6,14 +6,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** The properties that define a step. */ @Fluent public final class PrePostStep { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrePostStep.class); - /* * The resource Id of the step to be run. */ @@ -47,9 +44,11 @@ public PrePostStep withStepId(String stepId) { */ public void validate() { if (stepId() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property stepId in model PrePostStep")); } } + + private static final ClientLogger LOGGER = new ClientLogger(PrePostStep.class); } diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ResourceOperation.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ResourceOperation.java index 967696257e4d0..6896e16fa18a1 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ResourceOperation.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ResourceOperation.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.deploymentmanager.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Individual resource operation information. */ @Fluent public final class ResourceOperation { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceOperation.class); - /* * Name of the resource as specified in the artifacts. For ARM resources, * this is the name of the resource specified in the template. diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/RestHealthCheck.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/RestHealthCheck.java index f20fab51a9088..a8651d7af890a 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/RestHealthCheck.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/RestHealthCheck.java @@ -6,14 +6,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** A REST based health check. */ @Fluent public final class RestHealthCheck { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RestHealthCheck.class); - /* * A unique name for this check. */ @@ -103,12 +100,12 @@ public RestHealthCheck withResponse(RestResponse response) { */ public void validate() { if (name() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property name in model RestHealthCheck")); } if (request() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property request in model RestHealthCheck")); } else { @@ -118,4 +115,6 @@ public void validate() { response().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(RestHealthCheck.class); } diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/RestHealthCheckStepAttributes.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/RestHealthCheckStepAttributes.java index 347c3b25ef2b5..fc77f3b3f9303 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/RestHealthCheckStepAttributes.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/RestHealthCheckStepAttributes.java @@ -5,9 +5,7 @@ package com.azure.resourcemanager.deploymentmanager.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.resourcemanager.deploymentmanager.fluent.models.RestParameters; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -16,35 +14,21 @@ /** Defines the REST health check step properties. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") @JsonTypeName("REST") -@JsonFlatten @Fluent -public class RestHealthCheckStepAttributes extends HealthCheckStepAttributes { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RestHealthCheckStepAttributes.class); - +public final class RestHealthCheckStepAttributes extends HealthCheckStepAttributes { /* - * The list of checks that form the health check step. + * The REST health check parameters. */ - @JsonProperty(value = "properties.healthChecks") - private List healthChecks; + @JsonProperty(value = "properties") + private RestParameters innerProperties; /** - * Get the healthChecks property: The list of checks that form the health check step. + * Get the innerProperties property: The REST health check parameters. * - * @return the healthChecks value. + * @return the innerProperties value. */ - public List healthChecks() { - return this.healthChecks; - } - - /** - * Set the healthChecks property: The list of checks that form the health check step. - * - * @param healthChecks the healthChecks value to set. - * @return the RestHealthCheckStepAttributes object itself. - */ - public RestHealthCheckStepAttributes withHealthChecks(List healthChecks) { - this.healthChecks = healthChecks; - return this; + private RestParameters innerProperties() { + return this.innerProperties; } /** {@inheritDoc} */ @@ -68,6 +52,29 @@ public RestHealthCheckStepAttributes withHealthyStateDuration(String healthyStat return this; } + /** + * Get the healthChecks property: The list of checks that form the health check step. + * + * @return the healthChecks value. + */ + public List healthChecks() { + return this.innerProperties() == null ? null : this.innerProperties().healthChecks(); + } + + /** + * Set the healthChecks property: The list of checks that form the health check step. + * + * @param healthChecks the healthChecks value to set. + * @return the RestHealthCheckStepAttributes object itself. + */ + public RestHealthCheckStepAttributes withHealthChecks(List healthChecks) { + if (this.innerProperties() == null) { + this.innerProperties = new RestParameters(); + } + this.innerProperties().withHealthChecks(healthChecks); + return this; + } + /** * Validates the instance. * @@ -76,8 +83,8 @@ public RestHealthCheckStepAttributes withHealthyStateDuration(String healthyStat @Override public void validate() { super.validate(); - if (healthChecks() != null) { - healthChecks().forEach(e -> e.validate()); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/RestRequest.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/RestRequest.java index fcd31987911c9..5a75523ef7585 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/RestRequest.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/RestRequest.java @@ -6,14 +6,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** The properties that make up a REST request. */ @Fluent public final class RestRequest { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RestRequest.class); - /* * The HTTP method to use for the request. */ @@ -100,21 +97,23 @@ public RestRequest withAuthentication(RestRequestAuthentication authentication) */ public void validate() { if (method() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property method in model RestRequest")); } if (uri() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property uri in model RestRequest")); } if (authentication() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property authentication in model RestRequest")); } else { authentication().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(RestRequest.class); } diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/RestRequestAuthentication.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/RestRequestAuthentication.java index fc5ed87c1c2b1..3f783f15750cd 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/RestRequestAuthentication.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/RestRequestAuthentication.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.deploymentmanager.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -24,8 +22,6 @@ }) @Immutable public class RestRequestAuthentication { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RestRequestAuthentication.class); - /** * Validates the instance. * diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/RestResponse.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/RestResponse.java index 5d07fe3679136..2d50b553c58cc 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/RestResponse.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/RestResponse.java @@ -5,16 +5,12 @@ package com.azure.resourcemanager.deploymentmanager.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** The properties that make up the expected REST response. */ @Fluent public final class RestResponse { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RestResponse.class); - /* * The HTTP status codes expected in a successful health check response. * The response is expected to match one of the given status codes. If no diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/RestResponseRegex.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/RestResponseRegex.java index 024d88eb17eca..605ab543891bc 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/RestResponseRegex.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/RestResponseRegex.java @@ -5,16 +5,12 @@ package com.azure.resourcemanager.deploymentmanager.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** The regular expressions to match the response content with. */ @Fluent public final class RestResponseRegex { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RestResponseRegex.class); - /* * The list of regular expressions. */ diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/Rollout.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/Rollout.java index e5de7943187b6..79b07321a8481 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/Rollout.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/Rollout.java @@ -53,63 +53,63 @@ public interface Rollout { Identity identity(); /** - * Gets the buildVersion property: The version of the build being deployed. + * Gets the status property: The current status of the rollout. * - * @return the buildVersion value. + * @return the status value. */ - String buildVersion(); + String status(); /** - * Gets the artifactSourceId property: The reference to the artifact source resource Id where the payload is - * located. + * Gets the totalRetryAttempts property: The cardinal count of total number of retries performed on the rollout at a + * given time. * - * @return the artifactSourceId value. + * @return the totalRetryAttempts value. */ - String artifactSourceId(); + Integer totalRetryAttempts(); /** - * Gets the targetServiceTopologyId property: The resource Id of the service topology from which service units are - * being referenced in step groups to be deployed. + * Gets the operationInfo property: Operational information of the rollout. * - * @return the targetServiceTopologyId value. + * @return the operationInfo value. */ - String targetServiceTopologyId(); + RolloutOperationInfo operationInfo(); /** - * Gets the stepGroups property: The list of step groups that define the orchestration. + * Gets the services property: The detailed information on the services being deployed. * - * @return the stepGroups value. + * @return the services value. */ - List stepGroups(); + List services(); /** - * Gets the status property: The current status of the rollout. + * Gets the buildVersion property: The version of the build being deployed. * - * @return the status value. + * @return the buildVersion value. */ - String status(); + String buildVersion(); /** - * Gets the totalRetryAttempts property: The cardinal count of total number of retries performed on the rollout at a - * given time. + * Gets the artifactSourceId property: The reference to the artifact source resource Id where the payload is + * located. * - * @return the totalRetryAttempts value. + * @return the artifactSourceId value. */ - Integer totalRetryAttempts(); + String artifactSourceId(); /** - * Gets the operationInfo property: Operational information of the rollout. + * Gets the targetServiceTopologyId property: The resource Id of the service topology from which service units are + * being referenced in step groups to be deployed. * - * @return the operationInfo value. + * @return the targetServiceTopologyId value. */ - RolloutOperationInfo operationInfo(); + String targetServiceTopologyId(); /** - * Gets the services property: The detailed information on the services being deployed. + * Gets the stepGroups property: The list of step groups that define the orchestration. * - * @return the services value. + * @return the stepGroups value. */ - List services(); + List stepGroups(); /** * Gets the inner com.azure.resourcemanager.deploymentmanager.fluent.models.RolloutInner object. diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/RolloutIdentityAuthentication.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/RolloutIdentityAuthentication.java index 2bffd7b840d12..0a20e91bf1dd9 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/RolloutIdentityAuthentication.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/RolloutIdentityAuthentication.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.deploymentmanager.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -18,8 +16,6 @@ @JsonTypeName("RolloutIdentity") @Immutable public final class RolloutIdentityAuthentication extends RestRequestAuthentication { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RolloutIdentityAuthentication.class); - /** * Validates the instance. * diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/RolloutOperationInfo.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/RolloutOperationInfo.java index b3a6e2418c9b9..bcf45e48b4691 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/RolloutOperationInfo.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/RolloutOperationInfo.java @@ -6,16 +6,12 @@ import com.azure.core.annotation.Immutable; import com.azure.core.management.exception.ManagementError; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; /** Detailed runtime information of the rollout. */ @Immutable public final class RolloutOperationInfo { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RolloutOperationInfo.class); - /* * The ordinal count of the number of retry attempts on a rollout. 0 if no * retries of the rollout have been performed. If the rollout is updated diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/RolloutPropertiesAutoGenerated.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/RolloutPropertiesAutoGenerated.java index 820652c8d9c51..64bb8b1ff7046 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/RolloutPropertiesAutoGenerated.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/RolloutPropertiesAutoGenerated.java @@ -5,16 +5,12 @@ package com.azure.resourcemanager.deploymentmanager.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Defines the properties of a rollout. */ @Immutable public class RolloutPropertiesAutoGenerated { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RolloutPropertiesAutoGenerated.class); - /* * The current status of the rollout. */ diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/RolloutRequest.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/RolloutRequest.java index 881b171b68dac..53e471017eaa1 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/RolloutRequest.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/RolloutRequest.java @@ -99,6 +99,13 @@ public interface RolloutRequest { */ String regionName(); + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + /** * Gets the inner com.azure.resourcemanager.deploymentmanager.fluent.models.RolloutRequestInner object. * @@ -346,7 +353,7 @@ interface WithStepGroups { * @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 defines the rollout. + * @return defines the rollout along with {@link Response}. */ Response cancelWithResponse(Context context); @@ -369,7 +376,7 @@ interface WithStepGroups { * @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 defines the rollout. + * @return defines the rollout along with {@link Response}. */ Response restartWithResponse(Boolean skipSucceeded, Context context); } diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/RolloutStep.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/RolloutStep.java index 37fe580af2289..b26df566a58d2 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/RolloutStep.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/RolloutStep.java @@ -6,15 +6,12 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Defines a specific step on a target service unit. */ @Fluent public final class RolloutStep { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RolloutStep.class); - /* * Name of the step. */ @@ -136,7 +133,7 @@ public List messages() { */ public void validate() { if (name() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property name in model RolloutStep")); } @@ -150,4 +147,6 @@ public void validate() { messages().forEach(e -> e.validate()); } } + + private static final ClientLogger LOGGER = new ClientLogger(RolloutStep.class); } diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/Rollouts.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/Rollouts.java index e08cf5bc72399..53655f2914e64 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/Rollouts.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/Rollouts.java @@ -33,7 +33,7 @@ public interface Rollouts { * @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 detailed information of a rollout. + * @return detailed information of a rollout along with {@link Response}. */ Response getByResourceGroupWithResponse( String resourceGroupName, String rolloutName, Integer retryAttempt, Context context); @@ -58,7 +58,7 @@ Response getByResourceGroupWithResponse( * @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. + * @return the {@link Response}. */ Response deleteWithResponse(String resourceGroupName, String rolloutName, Context context); @@ -83,7 +83,7 @@ Response getByResourceGroupWithResponse( * @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 defines the rollout. + * @return defines the rollout along with {@link Response}. */ Response cancelWithResponse(String resourceGroupName, String rolloutName, Context context); @@ -111,7 +111,7 @@ Response getByResourceGroupWithResponse( * @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 defines the rollout. + * @return defines the rollout along with {@link Response}. */ Response restartWithResponse( String resourceGroupName, String rolloutName, Boolean skipSucceeded, Context context); @@ -135,7 +135,7 @@ Response restartWithResponse( * @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 list of rollouts. + * @return the list of rollouts along with {@link Response}. */ Response> listWithResponse(String resourceGroupName, Context context); @@ -157,7 +157,7 @@ Response restartWithResponse( * @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. + * @return the {@link Response}. */ Response deleteByIdWithResponse(String id, Context context); diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/RolloutsCreateOrUpdateHeaders.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/RolloutsCreateOrUpdateHeaders.java deleted file mode 100644 index 1dde087d8ca57..0000000000000 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/RolloutsCreateOrUpdateHeaders.java +++ /dev/null @@ -1,50 +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.deploymentmanager.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The RolloutsCreateOrUpdateHeaders model. */ -@Fluent -public final class RolloutsCreateOrUpdateHeaders { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RolloutsCreateOrUpdateHeaders.class); - - /* - * The Azure-AsyncOperation property. - */ - @JsonProperty(value = "Azure-AsyncOperation") - private String azureAsyncOperation; - - /** - * Get the azureAsyncOperation property: The Azure-AsyncOperation property. - * - * @return the azureAsyncOperation value. - */ - public String azureAsyncOperation() { - return this.azureAsyncOperation; - } - - /** - * Set the azureAsyncOperation property: The Azure-AsyncOperation property. - * - * @param azureAsyncOperation the azureAsyncOperation value to set. - * @return the RolloutsCreateOrUpdateHeaders object itself. - */ - public RolloutsCreateOrUpdateHeaders withAzureAsyncOperation(String azureAsyncOperation) { - this.azureAsyncOperation = azureAsyncOperation; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/RolloutsCreateOrUpdateResponse.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/RolloutsCreateOrUpdateResponse.java deleted file mode 100644 index 8fa6545ca3c98..0000000000000 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/RolloutsCreateOrUpdateResponse.java +++ /dev/null @@ -1,38 +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.deploymentmanager.models; - -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.rest.ResponseBase; -import com.azure.resourcemanager.deploymentmanager.fluent.models.RolloutRequestInner; - -/** Contains all response data for the createOrUpdate operation. */ -public final class RolloutsCreateOrUpdateResponse - extends ResponseBase { - /** - * Creates an instance of RolloutsCreateOrUpdateResponse. - * - * @param request the request which resulted in this RolloutsCreateOrUpdateResponse. - * @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 RolloutsCreateOrUpdateResponse( - HttpRequest request, - int statusCode, - HttpHeaders rawHeaders, - RolloutRequestInner value, - RolloutsCreateOrUpdateHeaders headers) { - super(request, statusCode, rawHeaders, value, headers); - } - - /** @return the deserialized response body. */ - @Override - public RolloutRequestInner getValue() { - return super.getValue(); - } -} diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/SasAuthentication.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/SasAuthentication.java index ca5163f5a3882..9fc1c0c5be24f 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/SasAuthentication.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/SasAuthentication.java @@ -5,9 +5,7 @@ package com.azure.resourcemanager.deploymentmanager.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.resourcemanager.deploymentmanager.fluent.models.SasProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -15,18 +13,22 @@ /** Defines the properties to access the artifacts using an Azure Storage SAS URI. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") @JsonTypeName("Sas") -@JsonFlatten @Fluent -public class SasAuthentication extends Authentication { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SasAuthentication.class); - +public final class SasAuthentication extends Authentication { /* - * The SAS URI to the Azure Storage blob container. Any offset from the - * root of the container to where the artifacts are located can be defined - * in the artifactRoot. + * The SAS properties + */ + @JsonProperty(value = "properties") + private SasProperties innerProperties; + + /** + * Get the innerProperties property: The SAS properties. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.sasUri") - private String sasUri; + private SasProperties innerProperties() { + return this.innerProperties; + } /** * Get the sasUri property: The SAS URI to the Azure Storage blob container. Any offset from the root of the @@ -35,7 +37,7 @@ public class SasAuthentication extends Authentication { * @return the sasUri value. */ public String sasUri() { - return this.sasUri; + return this.innerProperties() == null ? null : this.innerProperties().sasUri(); } /** @@ -46,7 +48,10 @@ public String sasUri() { * @return the SasAuthentication object itself. */ public SasAuthentication withSasUri(String sasUri) { - this.sasUri = sasUri; + if (this.innerProperties() == null) { + this.innerProperties = new SasProperties(); + } + this.innerProperties().withSasUri(sasUri); return this; } @@ -58,5 +63,8 @@ public SasAuthentication withSasUri(String sasUri) { @Override public void validate() { super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } } } diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/Service.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/Service.java index 668ba91d7ad9a..896ae3cf164a6 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/Service.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/Service.java @@ -5,16 +5,12 @@ package com.azure.resourcemanager.deploymentmanager.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Defines a service. */ @Fluent public final class Service extends ServiceProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Service.class); - /* * Name of the service. */ diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ServiceProperties.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ServiceProperties.java index 2240440f1eeeb..0c07cb84e4ace 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ServiceProperties.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ServiceProperties.java @@ -6,14 +6,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** The properties of a service. */ @Fluent public class ServiceProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceProperties.class); - /* * The Azure location to which the resources in the service belong to or * should be deployed to. @@ -79,16 +76,18 @@ public ServiceProperties withTargetSubscriptionId(String targetSubscriptionId) { */ public void validate() { if (targetLocation() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property targetLocation in model ServiceProperties")); } if (targetSubscriptionId() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property targetSubscriptionId in model ServiceProperties")); } } + + private static final ClientLogger LOGGER = new ClientLogger(ServiceProperties.class); } diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ServiceResource.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ServiceResource.java index 1f16428ff04aa..49160714702ec 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ServiceResource.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ServiceResource.java @@ -46,22 +46,6 @@ public interface ServiceResource { */ Map tags(); - /** - * Gets the targetLocation property: The Azure location to which the resources in the service belong to or should be - * deployed to. - * - * @return the targetLocation value. - */ - String targetLocation(); - - /** - * Gets the targetSubscriptionId property: The subscription to which the resources in the service belong to or - * should be deployed to. - * - * @return the targetSubscriptionId value. - */ - String targetSubscriptionId(); - /** * Gets the region of the resource. * @@ -76,6 +60,13 @@ public interface ServiceResource { */ String regionName(); + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + /** * Gets the inner com.azure.resourcemanager.deploymentmanager.fluent.models.ServiceResourceInner object. * @@ -88,8 +79,6 @@ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, DefinitionStages.WithParentResource, - DefinitionStages.WithTargetLocation, - DefinitionStages.WithTargetSubscriptionId, DefinitionStages.WithCreate { } /** The ServiceResource definition stages. */ @@ -124,31 +113,7 @@ interface WithParentResource { * @param serviceTopologyName The name of the service topology . * @return the next definition stage. */ - WithTargetLocation withExistingServiceTopology(String resourceGroupName, String serviceTopologyName); - } - /** The stage of the ServiceResource definition allowing to specify targetLocation. */ - interface WithTargetLocation { - /** - * Specifies the targetLocation property: The Azure location to which the resources in the service belong to - * or should be deployed to.. - * - * @param targetLocation The Azure location to which the resources in the service belong to or should be - * deployed to. - * @return the next definition stage. - */ - WithTargetSubscriptionId withTargetLocation(String targetLocation); - } - /** The stage of the ServiceResource definition allowing to specify targetSubscriptionId. */ - interface WithTargetSubscriptionId { - /** - * Specifies the targetSubscriptionId property: The subscription to which the resources in the service - * belong to or should be deployed to.. - * - * @param targetSubscriptionId The subscription to which the resources in the service belong to or should be - * deployed to. - * @return the next definition stage. - */ - WithCreate withTargetSubscriptionId(String targetSubscriptionId); + WithCreate withExistingServiceTopology(String resourceGroupName, String serviceTopologyName); } /** * The stage of the ServiceResource definition which contains all the minimum required properties for the @@ -189,8 +154,7 @@ interface WithTags { ServiceResource.Update update(); /** The template for ServiceResource update. */ - interface Update - extends UpdateStages.WithTags, UpdateStages.WithTargetLocation, UpdateStages.WithTargetSubscriptionId { + interface Update extends UpdateStages.WithTags { /** * Executes the update request. * @@ -218,30 +182,6 @@ interface WithTags { */ Update withTags(Map tags); } - /** The stage of the ServiceResource update allowing to specify targetLocation. */ - interface WithTargetLocation { - /** - * Specifies the targetLocation property: The Azure location to which the resources in the service belong to - * or should be deployed to.. - * - * @param targetLocation The Azure location to which the resources in the service belong to or should be - * deployed to. - * @return the next definition stage. - */ - Update withTargetLocation(String targetLocation); - } - /** The stage of the ServiceResource update allowing to specify targetSubscriptionId. */ - interface WithTargetSubscriptionId { - /** - * Specifies the targetSubscriptionId property: The subscription to which the resources in the service - * belong to or should be deployed to.. - * - * @param targetSubscriptionId The subscription to which the resources in the service belong to or should be - * deployed to. - * @return the next definition stage. - */ - Update withTargetSubscriptionId(String targetSubscriptionId); - } } /** * Refreshes the resource to sync with Azure. diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ServiceTopologies.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ServiceTopologies.java index 2e99e470f13f3..47514730b87ae 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ServiceTopologies.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ServiceTopologies.java @@ -31,7 +31,7 @@ public interface ServiceTopologies { * @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 service topology. + * @return the service topology along with {@link Response}. */ Response getByResourceGroupWithResponse( String resourceGroupName, String serviceTopologyName, Context context); @@ -56,7 +56,7 @@ Response getByResourceGroupWithResponse( * @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. + * @return the {@link Response}. */ Response deleteWithResponse(String resourceGroupName, String serviceTopologyName, Context context); @@ -79,7 +79,7 @@ Response getByResourceGroupWithResponse( * @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 list of service topologies. + * @return the list of service topologies along with {@link Response}. */ Response> listWithResponse(String resourceGroupName, Context context); @@ -90,7 +90,7 @@ Response getByResourceGroupWithResponse( * @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 service topology. + * @return the service topology along with {@link Response}. */ ServiceTopologyResource getById(String id); @@ -102,7 +102,7 @@ Response getByResourceGroupWithResponse( * @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 service topology. + * @return the service topology along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); @@ -124,7 +124,7 @@ Response getByResourceGroupWithResponse( * @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. + * @return the {@link Response}. */ Response deleteByIdWithResponse(String id, Context context); diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ServiceTopologyProperties.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ServiceTopologyProperties.java index c0e39172abe3d..f0e16245f6711 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ServiceTopologyProperties.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ServiceTopologyProperties.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.deploymentmanager.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** The properties of a service topology. */ @Fluent public class ServiceTopologyProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceTopologyProperties.class); - /* * The resource Id of the artifact source that contains the artifacts that * can be referenced in the service units. diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ServiceTopologyResource.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ServiceTopologyResource.java index e276ca5a86d47..6671915b74434 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ServiceTopologyResource.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ServiceTopologyResource.java @@ -46,14 +46,6 @@ public interface ServiceTopologyResource { */ Map tags(); - /** - * Gets the artifactSourceId property: The resource Id of the artifact source that contains the artifacts that can - * be referenced in the service units. - * - * @return the artifactSourceId value. - */ - String artifactSourceId(); - /** * Gets the region of the resource. * @@ -68,6 +60,13 @@ public interface ServiceTopologyResource { */ String regionName(); + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + /** * Gets the inner com.azure.resourcemanager.deploymentmanager.fluent.models.ServiceTopologyResourceInner object. * @@ -119,7 +118,7 @@ interface WithResourceGroup { * The stage of the ServiceTopologyResource 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.WithArtifactSourceId { + interface WithCreate extends DefinitionStages.WithTags { /** * Executes the create request. * @@ -145,18 +144,6 @@ interface WithTags { */ WithCreate withTags(Map tags); } - /** The stage of the ServiceTopologyResource definition allowing to specify artifactSourceId. */ - interface WithArtifactSourceId { - /** - * Specifies the artifactSourceId property: The resource Id of the artifact source that contains the - * artifacts that can be referenced in the service units.. - * - * @param artifactSourceId The resource Id of the artifact source that contains the artifacts that can be - * referenced in the service units. - * @return the next definition stage. - */ - WithCreate withArtifactSourceId(String artifactSourceId); - } } /** * Begins update for the ServiceTopologyResource resource. @@ -166,7 +153,7 @@ interface WithArtifactSourceId { ServiceTopologyResource.Update update(); /** The template for ServiceTopologyResource update. */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithArtifactSourceId { + interface Update extends UpdateStages.WithTags { /** * Executes the update request. * @@ -194,18 +181,6 @@ interface WithTags { */ Update withTags(Map tags); } - /** The stage of the ServiceTopologyResource update allowing to specify artifactSourceId. */ - interface WithArtifactSourceId { - /** - * Specifies the artifactSourceId property: The resource Id of the artifact source that contains the - * artifacts that can be referenced in the service units.. - * - * @param artifactSourceId The resource Id of the artifact source that contains the artifacts that can be - * referenced in the service units. - * @return the next definition stage. - */ - Update withArtifactSourceId(String artifactSourceId); - } } /** * Refreshes the resource to sync with Azure. diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ServiceUnit.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ServiceUnit.java index 00b5623af29ab..c907d55e7c4a6 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ServiceUnit.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ServiceUnit.java @@ -5,16 +5,12 @@ package com.azure.resourcemanager.deploymentmanager.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Defines a service unit. */ @Fluent public final class ServiceUnit extends ServiceUnitProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceUnit.class); - /* * Name of the service unit. */ diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ServiceUnitArtifacts.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ServiceUnitArtifacts.java index a62f7b8671f75..cb4f8db305862 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ServiceUnitArtifacts.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ServiceUnitArtifacts.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.deploymentmanager.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Defines the artifacts of a service unit. */ @Fluent public final class ServiceUnitArtifacts { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceUnitArtifacts.class); - /* * The full URI of the ARM template file with the SAS token. */ diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ServiceUnitProperties.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ServiceUnitProperties.java index 0880bf08be183..83d27b1f25a58 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ServiceUnitProperties.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ServiceUnitProperties.java @@ -6,14 +6,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Defines the properties of a service unit. */ @Fluent public class ServiceUnitProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceUnitProperties.class); - /* * The Azure Resource Group to which the resources in the service unit * belong to or should be deployed to. @@ -102,13 +99,13 @@ public ServiceUnitProperties withArtifacts(ServiceUnitArtifacts artifacts) { */ public void validate() { if (targetResourceGroup() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property targetResourceGroup in model ServiceUnitProperties")); } if (deploymentMode() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property deploymentMode in model ServiceUnitProperties")); @@ -117,4 +114,6 @@ public void validate() { artifacts().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(ServiceUnitProperties.class); } diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ServiceUnitResource.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ServiceUnitResource.java index e9868cf930149..17bbfc76f0a27 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ServiceUnitResource.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ServiceUnitResource.java @@ -46,28 +46,6 @@ public interface ServiceUnitResource { */ Map tags(); - /** - * Gets the targetResourceGroup property: The Azure Resource Group to which the resources in the service unit belong - * to or should be deployed to. - * - * @return the targetResourceGroup value. - */ - String targetResourceGroup(); - - /** - * Gets the deploymentMode property: Describes the type of ARM deployment to be performed on the resource. - * - * @return the deploymentMode value. - */ - DeploymentMode deploymentMode(); - - /** - * Gets the artifacts property: The artifacts for the service unit. - * - * @return the artifacts value. - */ - ServiceUnitArtifacts artifacts(); - /** * Gets the region of the resource. * @@ -82,6 +60,13 @@ public interface ServiceUnitResource { */ String regionName(); + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + /** * Gets the inner com.azure.resourcemanager.deploymentmanager.fluent.models.ServiceUnitResourceInner object. * @@ -94,8 +79,6 @@ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, DefinitionStages.WithParentResource, - DefinitionStages.WithTargetResourceGroup, - DefinitionStages.WithDeploymentMode, DefinitionStages.WithCreate { } /** The ServiceUnitResource definition stages. */ @@ -131,37 +114,13 @@ interface WithParentResource { * @param serviceName The name of the service resource. * @return the next definition stage. */ - WithTargetResourceGroup withExistingService( - String resourceGroupName, String serviceTopologyName, String serviceName); - } - /** The stage of the ServiceUnitResource definition allowing to specify targetResourceGroup. */ - interface WithTargetResourceGroup { - /** - * Specifies the targetResourceGroup property: The Azure Resource Group to which the resources in the - * service unit belong to or should be deployed to.. - * - * @param targetResourceGroup The Azure Resource Group to which the resources in the service unit belong to - * or should be deployed to. - * @return the next definition stage. - */ - WithDeploymentMode withTargetResourceGroup(String targetResourceGroup); - } - /** The stage of the ServiceUnitResource definition allowing to specify deploymentMode. */ - interface WithDeploymentMode { - /** - * Specifies the deploymentMode property: Describes the type of ARM deployment to be performed on the - * resource.. - * - * @param deploymentMode Describes the type of ARM deployment to be performed on the resource. - * @return the next definition stage. - */ - WithCreate withDeploymentMode(DeploymentMode deploymentMode); + WithCreate withExistingService(String resourceGroupName, String serviceTopologyName, String serviceName); } /** * The stage of the ServiceUnitResource 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.WithArtifacts { + interface WithCreate extends DefinitionStages.WithTags { /** * Executes the create request. * @@ -187,16 +146,6 @@ interface WithTags { */ WithCreate withTags(Map tags); } - /** The stage of the ServiceUnitResource definition allowing to specify artifacts. */ - interface WithArtifacts { - /** - * Specifies the artifacts property: The artifacts for the service unit.. - * - * @param artifacts The artifacts for the service unit. - * @return the next definition stage. - */ - WithCreate withArtifacts(ServiceUnitArtifacts artifacts); - } } /** * Begins update for the ServiceUnitResource resource. @@ -206,11 +155,7 @@ interface WithArtifacts { ServiceUnitResource.Update update(); /** The template for ServiceUnitResource update. */ - interface Update - extends UpdateStages.WithTags, - UpdateStages.WithTargetResourceGroup, - UpdateStages.WithDeploymentMode, - UpdateStages.WithArtifacts { + interface Update extends UpdateStages.WithTags { /** * Executes the update request. * @@ -238,39 +183,6 @@ interface WithTags { */ Update withTags(Map tags); } - /** The stage of the ServiceUnitResource update allowing to specify targetResourceGroup. */ - interface WithTargetResourceGroup { - /** - * Specifies the targetResourceGroup property: The Azure Resource Group to which the resources in the - * service unit belong to or should be deployed to.. - * - * @param targetResourceGroup The Azure Resource Group to which the resources in the service unit belong to - * or should be deployed to. - * @return the next definition stage. - */ - Update withTargetResourceGroup(String targetResourceGroup); - } - /** The stage of the ServiceUnitResource update allowing to specify deploymentMode. */ - interface WithDeploymentMode { - /** - * Specifies the deploymentMode property: Describes the type of ARM deployment to be performed on the - * resource.. - * - * @param deploymentMode Describes the type of ARM deployment to be performed on the resource. - * @return the next definition stage. - */ - Update withDeploymentMode(DeploymentMode deploymentMode); - } - /** The stage of the ServiceUnitResource update allowing to specify artifacts. */ - interface WithArtifacts { - /** - * Specifies the artifacts property: The artifacts for the service unit.. - * - * @param artifacts The artifacts for the service unit. - * @return the next definition stage. - */ - Update withArtifacts(ServiceUnitArtifacts artifacts); - } } /** * Refreshes the resource to sync with Azure. diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ServiceUnits.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ServiceUnits.java index 66c8ec5785417..67787233a8007 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ServiceUnits.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ServiceUnits.java @@ -36,7 +36,7 @@ ServiceUnitResource get( * @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 service unit. + * @return the service unit along with {@link Response}. */ Response getWithResponse( String resourceGroupName, @@ -69,7 +69,7 @@ Response getWithResponse( * @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. + * @return the {@link Response}. */ Response deleteWithResponse( String resourceGroupName, @@ -101,7 +101,7 @@ Response deleteWithResponse( * @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 list of service units. + * @return the list of service units along with {@link Response}. */ Response> listWithResponse( String resourceGroupName, String serviceTopologyName, String serviceName, Context context); @@ -113,7 +113,7 @@ Response> listWithResponse( * @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 service unit. + * @return the service unit along with {@link Response}. */ ServiceUnitResource getById(String id); @@ -125,7 +125,7 @@ Response> listWithResponse( * @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 service unit. + * @return the service unit along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); @@ -147,7 +147,7 @@ Response> listWithResponse( * @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. + * @return the {@link Response}. */ Response deleteByIdWithResponse(String id, Context context); diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ServiceUnitsCreateOrUpdateHeaders.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ServiceUnitsCreateOrUpdateHeaders.java deleted file mode 100644 index c9463db34d833..0000000000000 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ServiceUnitsCreateOrUpdateHeaders.java +++ /dev/null @@ -1,50 +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.deploymentmanager.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The ServiceUnitsCreateOrUpdateHeaders model. */ -@Fluent -public final class ServiceUnitsCreateOrUpdateHeaders { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceUnitsCreateOrUpdateHeaders.class); - - /* - * The Azure-AsyncOperation property. - */ - @JsonProperty(value = "Azure-AsyncOperation") - private String azureAsyncOperation; - - /** - * Get the azureAsyncOperation property: The Azure-AsyncOperation property. - * - * @return the azureAsyncOperation value. - */ - public String azureAsyncOperation() { - return this.azureAsyncOperation; - } - - /** - * Set the azureAsyncOperation property: The Azure-AsyncOperation property. - * - * @param azureAsyncOperation the azureAsyncOperation value to set. - * @return the ServiceUnitsCreateOrUpdateHeaders object itself. - */ - public ServiceUnitsCreateOrUpdateHeaders withAzureAsyncOperation(String azureAsyncOperation) { - this.azureAsyncOperation = azureAsyncOperation; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ServiceUnitsCreateOrUpdateResponse.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ServiceUnitsCreateOrUpdateResponse.java deleted file mode 100644 index 9d0354490d34f..0000000000000 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/ServiceUnitsCreateOrUpdateResponse.java +++ /dev/null @@ -1,38 +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.deploymentmanager.models; - -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.rest.ResponseBase; -import com.azure.resourcemanager.deploymentmanager.fluent.models.ServiceUnitResourceInner; - -/** Contains all response data for the createOrUpdate operation. */ -public final class ServiceUnitsCreateOrUpdateResponse - extends ResponseBase { - /** - * Creates an instance of ServiceUnitsCreateOrUpdateResponse. - * - * @param request the request which resulted in this ServiceUnitsCreateOrUpdateResponse. - * @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 ServiceUnitsCreateOrUpdateResponse( - HttpRequest request, - int statusCode, - HttpHeaders rawHeaders, - ServiceUnitResourceInner value, - ServiceUnitsCreateOrUpdateHeaders headers) { - super(request, statusCode, rawHeaders, value, headers); - } - - /** @return the deserialized response body. */ - @Override - public ServiceUnitResourceInner getValue() { - return super.getValue(); - } -} diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/Services.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/Services.java index 34d5d7fb61845..07cd2a44d213f 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/Services.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/Services.java @@ -33,7 +33,7 @@ public interface Services { * @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 service. + * @return the service along with {@link Response}. */ Response getWithResponse( String resourceGroupName, String serviceTopologyName, String serviceName, Context context); @@ -60,7 +60,7 @@ Response getWithResponse( * @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. + * @return the {@link Response}. */ Response deleteWithResponse( String resourceGroupName, String serviceTopologyName, String serviceName, Context context); @@ -86,7 +86,7 @@ Response deleteWithResponse( * @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 list of services. + * @return the list of services along with {@link Response}. */ Response> listWithResponse( String resourceGroupName, String serviceTopologyName, Context context); @@ -98,7 +98,7 @@ Response> listWithResponse( * @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 service. + * @return the service along with {@link Response}. */ ServiceResource getById(String id); @@ -110,7 +110,7 @@ Response> listWithResponse( * @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 service. + * @return the service along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); @@ -132,7 +132,7 @@ Response> listWithResponse( * @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. + * @return the {@link Response}. */ Response deleteByIdWithResponse(String id, Context context); diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/StepGroup.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/StepGroup.java index c7d66423686ae..518e9c3f987ff 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/StepGroup.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/StepGroup.java @@ -6,15 +6,12 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** The properties that define a Step group in a rollout. */ @Fluent public final class StepGroup { - @JsonIgnore private final ClientLogger logger = new ClientLogger(StepGroup.class); - /* * The name of the step group. */ @@ -155,14 +152,14 @@ public StepGroup withPostDeploymentSteps(List postDeploymentSteps) */ public void validate() { if (name() == null) { - throw logger + throw LOGGER .logExceptionAsError(new IllegalArgumentException("Missing required property name in model StepGroup")); } if (preDeploymentSteps() != null) { preDeploymentSteps().forEach(e -> e.validate()); } if (deploymentTargetId() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property deploymentTargetId in model StepGroup")); } @@ -170,4 +167,6 @@ public void validate() { postDeploymentSteps().forEach(e -> e.validate()); } } + + private static final ClientLogger LOGGER = new ClientLogger(StepGroup.class); } diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/StepOperationInfo.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/StepOperationInfo.java index 0d92f38b7c9c9..8cda72a678e8b 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/StepOperationInfo.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/StepOperationInfo.java @@ -6,16 +6,12 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.exception.ManagementError; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; /** Detailed information of a specific step run. */ @Fluent public final class StepOperationInfo { - @JsonIgnore private final ClientLogger logger = new ClientLogger(StepOperationInfo.class); - /* * The name of the ARM deployment initiated as part of the step. */ diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/StepProperties.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/StepProperties.java index 56abecc20fb44..706562fc1c8f7 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/StepProperties.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/StepProperties.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.deploymentmanager.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -24,8 +22,6 @@ }) @Immutable public class StepProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(StepProperties.class); - /** * Validates the instance. * diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/StepResource.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/StepResource.java index c38b16bf2c740..1de93394935ac 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/StepResource.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/StepResource.java @@ -67,6 +67,13 @@ public interface StepResource { */ String regionName(); + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + /** * Gets the inner com.azure.resourcemanager.deploymentmanager.fluent.models.StepResourceInner object. * diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/Steps.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/Steps.java index 2002aec7d2f84..ffcae588b7e01 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/Steps.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/Steps.java @@ -31,7 +31,7 @@ public interface Steps { * @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 step. + * @return the step along with {@link Response}. */ Response getByResourceGroupWithResponse(String resourceGroupName, String stepName, Context context); @@ -55,7 +55,7 @@ public interface Steps { * @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. + * @return the {@link Response}. */ Response deleteWithResponse(String resourceGroupName, String stepName, Context context); @@ -78,7 +78,7 @@ public interface Steps { * @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 list of steps. + * @return the list of steps along with {@link Response}. */ Response> listWithResponse(String resourceGroupName, Context context); @@ -89,7 +89,7 @@ public interface Steps { * @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 step. + * @return the step along with {@link Response}. */ StepResource getById(String id); @@ -101,7 +101,7 @@ public interface Steps { * @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 step. + * @return the step along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); @@ -123,7 +123,7 @@ public interface Steps { * @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. + * @return the {@link Response}. */ Response deleteByIdWithResponse(String id, Context context); diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/WaitStepAttributes.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/WaitStepAttributes.java index 966e38fe4ee3e..cf0d7e4547bc6 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/WaitStepAttributes.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/WaitStepAttributes.java @@ -6,14 +6,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** The parameters for the wait step. */ @Fluent public final class WaitStepAttributes { - @JsonIgnore private final ClientLogger logger = new ClientLogger(WaitStepAttributes.class); - /* * The duration in ISO 8601 format of how long the wait should be. */ @@ -47,9 +44,11 @@ public WaitStepAttributes withDuration(String duration) { */ public void validate() { if (duration() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property duration in model WaitStepAttributes")); } } + + private static final ClientLogger LOGGER = new ClientLogger(WaitStepAttributes.class); } diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/WaitStepProperties.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/WaitStepProperties.java index 368298e06364f..176b4c1a9e416 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/WaitStepProperties.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/WaitStepProperties.java @@ -6,7 +6,6 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -16,8 +15,6 @@ @JsonTypeName("Wait") @Fluent public final class WaitStepProperties extends StepProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(WaitStepProperties.class); - /* * The Wait attributes */ @@ -53,11 +50,13 @@ public WaitStepProperties withAttributes(WaitStepAttributes attributes) { public void validate() { super.validate(); if (attributes() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property attributes in model WaitStepProperties")); } else { attributes().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(WaitStepProperties.class); } diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/package-info.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/package-info.java index ac14fd4570342..872d676f81394 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/package-info.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/models/package-info.java @@ -5,6 +5,6 @@ /** * Package containing the data models for AzureDeploymentManager. REST APIs for orchestrating deployments using the * Azure Deployment Manager (ADM). See - * https://docs.microsoft.com/azure/azure-resource-manager/deployment-manager-overview for more information. + * https://docs.microsoft.com/en-us/azure/azure-resource-manager/deployment-manager-overview for more information. */ package com.azure.resourcemanager.deploymentmanager.models; diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/package-info.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/package-info.java index cf6251194e121..75f6aa5bb928c 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/package-info.java +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/main/java/com/azure/resourcemanager/deploymentmanager/package-info.java @@ -5,6 +5,6 @@ /** * Package containing the classes for AzureDeploymentManager. REST APIs for orchestrating deployments using the Azure * Deployment Manager (ADM). See - * https://docs.microsoft.com/azure/azure-resource-manager/deployment-manager-overview for more information. + * https://docs.microsoft.com/en-us/azure/azure-resource-manager/deployment-manager-overview for more information. */ package com.azure.resourcemanager.deploymentmanager; diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/ArtifactSourcesCreateOrUpdateSamples.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/ArtifactSourcesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..07c42ddb36de6 --- /dev/null +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/ArtifactSourcesCreateOrUpdateSamples.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.deploymentmanager.generated; + +import java.util.HashMap; +import java.util.Map; + +/** Samples for ArtifactSources CreateOrUpdate. */ +public final class ArtifactSourcesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/artifactsource_createorupdate.json + */ + /** + * Sample code: Create artifact source. + * + * @param manager Entry point to DeploymentManager. + */ + public static void createArtifactSource(com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager + .artifactSources() + .define("myArtifactSource") + .withRegion("centralus") + .withExistingResourceGroup("myResourceGroup") + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/artifactsource_createorupdate_artifactroot.json + */ + /** + * Sample code: Create artifact source with artifact root, an offset into the storage container. + * + * @param manager Entry point to DeploymentManager. + */ + public static void createArtifactSourceWithArtifactRootAnOffsetIntoTheStorageContainer( + com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager + .artifactSources() + .define("myArtifactSource") + .withRegion("centralus") + .withExistingResourceGroup("myResourceGroup") + .withTags(mapOf()) + .create(); + } + + @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/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/ArtifactSourcesDeleteSamples.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/ArtifactSourcesDeleteSamples.java new file mode 100644 index 0000000000000..f753acb0b0a47 --- /dev/null +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/ArtifactSourcesDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.deploymentmanager.generated; + +import com.azure.core.util.Context; + +/** Samples for ArtifactSources Delete. */ +public final class ArtifactSourcesDeleteSamples { + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/artifactsource_delete.json + */ + /** + * Sample code: Delete artifact source. + * + * @param manager Entry point to DeploymentManager. + */ + public static void deleteArtifactSource(com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager.artifactSources().deleteWithResponse("myResourceGroup", "myArtifactSource", Context.NONE); + } +} diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/ArtifactSourcesGetByResourceGroupSamples.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/ArtifactSourcesGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..860895005d5e9 --- /dev/null +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/ArtifactSourcesGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.deploymentmanager.generated; + +import com.azure.core.util.Context; + +/** Samples for ArtifactSources GetByResourceGroup. */ +public final class ArtifactSourcesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/artifactsource_get.json + */ + /** + * Sample code: Get artifact source. + * + * @param manager Entry point to DeploymentManager. + */ + public static void getArtifactSource(com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager.artifactSources().getByResourceGroupWithResponse("myResourceGroup", "myArtifactSource", Context.NONE); + } +} diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/ArtifactSourcesListSamples.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/ArtifactSourcesListSamples.java new file mode 100644 index 0000000000000..b4ff407e557d7 --- /dev/null +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/ArtifactSourcesListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.deploymentmanager.generated; + +import com.azure.core.util.Context; + +/** Samples for ArtifactSources List. */ +public final class ArtifactSourcesListSamples { + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/artifactsources_list.json + */ + /** + * Sample code: List steps. + * + * @param manager Entry point to DeploymentManager. + */ + public static void listSteps(com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager.artifactSources().listWithResponse("myResourceGroup", Context.NONE); + } +} diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/OperationsListSamples.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/OperationsListSamples.java new file mode 100644 index 0000000000000..59fc5803504f5 --- /dev/null +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/OperationsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.deploymentmanager.generated; + +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/operations_list.json + */ + /** + * Sample code: Get operations. + * + * @param manager Entry point to DeploymentManager. + */ + public static void getOperations(com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager.operations().listWithResponse(Context.NONE); + } +} diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/RolloutsCancelSamples.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/RolloutsCancelSamples.java new file mode 100644 index 0000000000000..7a3cfd919a551 --- /dev/null +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/RolloutsCancelSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.deploymentmanager.generated; + +import com.azure.core.util.Context; + +/** Samples for Rollouts Cancel. */ +public final class RolloutsCancelSamples { + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/rollout_post_cancel.json + */ + /** + * Sample code: Cancel rollout. + * + * @param manager Entry point to DeploymentManager. + */ + public static void cancelRollout(com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager.rollouts().cancelWithResponse("myResourceGroup", "myRollout", Context.NONE); + } +} diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/RolloutsCreateOrUpdateSamples.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/RolloutsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..a12af7a32233c --- /dev/null +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/RolloutsCreateOrUpdateSamples.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.deploymentmanager.generated; + +import com.azure.resourcemanager.deploymentmanager.models.Identity; +import com.azure.resourcemanager.deploymentmanager.models.PrePostStep; +import com.azure.resourcemanager.deploymentmanager.models.StepGroup; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Rollouts CreateOrUpdate. */ +public final class RolloutsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/rollout_createorupdate.json + */ + /** + * Sample code: Create or update rollout. + * + * @param manager Entry point to DeploymentManager. + */ + public static void createOrUpdateRollout(com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager + .rollouts() + .define("myRollout") + .withRegion("centralus") + .withExistingResourceGroup("myResourceGroup") + .withIdentity( + new Identity() + .withType("userAssigned") + .withIdentityIds( + Arrays + .asList( + "/subscriptions/caac1590-e859-444f-a9e0-62091c0f5929/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userassignedidentities/myuseridentity"))) + .withBuildVersion("1.0.0.1") + .withTargetServiceTopologyId( + "/subscriptions/caac1590-e859-444f-a9e0-62091c0f5929/resourceGroups/myResourceGroup/Microsoft.DeploymentManager/serviceTopologies/myTopology") + .withStepGroups( + Arrays + .asList( + new StepGroup() + .withName("FirstRegion") + .withPreDeploymentSteps( + Arrays + .asList( + new PrePostStep() + .withStepId("Microsoft.DeploymentManager/steps/preDeployStep1"), + new PrePostStep() + .withStepId("Microsoft.DeploymentManager/steps/preDeployStep2"))) + .withDeploymentTargetId( + "Microsoft.DeploymentManager/serviceTopologies/myTopology/services/myService/serviceUnits/myServiceUnit1'") + .withPostDeploymentSteps( + Arrays + .asList( + new PrePostStep() + .withStepId("Microsoft.DeploymentManager/steps/postDeployStep1"))), + new StepGroup() + .withName("SecondRegion") + .withDependsOnStepGroups(Arrays.asList("FirstRegion")) + .withPreDeploymentSteps( + Arrays + .asList( + new PrePostStep() + .withStepId("Microsoft.DeploymentManager/steps/preDeployStep3"), + new PrePostStep() + .withStepId("Microsoft.DeploymentManager/steps/preDeployStep4"))) + .withDeploymentTargetId( + "Microsoft.DeploymentManager/serviceTopologies/myTopology/services/myService/serviceUnits/myServiceUnit2'") + .withPostDeploymentSteps( + Arrays + .asList( + new PrePostStep() + .withStepId("Microsoft.DeploymentManager/steps/postDeployStep5"))))) + .withTags(mapOf()) + .withArtifactSourceId( + "/subscriptions/caac1590-e859-444f-a9e0-62091c0f5929/resourceGroups/myResourceGroup/Microsoft.DeploymentManager/artifactSources/myArtifactSource") + .create(); + } + + @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/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/RolloutsDeleteSamples.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/RolloutsDeleteSamples.java new file mode 100644 index 0000000000000..37fc850460b3e --- /dev/null +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/RolloutsDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.deploymentmanager.generated; + +import com.azure.core.util.Context; + +/** Samples for Rollouts Delete. */ +public final class RolloutsDeleteSamples { + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/rollout_delete.json + */ + /** + * Sample code: Delete rollout. + * + * @param manager Entry point to DeploymentManager. + */ + public static void deleteRollout(com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager.rollouts().deleteWithResponse("myResourceGroup", "myRollout", Context.NONE); + } +} diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/RolloutsGetByResourceGroupSamples.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/RolloutsGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..9fd357faa1841 --- /dev/null +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/RolloutsGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.deploymentmanager.generated; + +import com.azure.core.util.Context; + +/** Samples for Rollouts GetByResourceGroup. */ +public final class RolloutsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/rollout_get.json + */ + /** + * Sample code: Get rollout. + * + * @param manager Entry point to DeploymentManager. + */ + public static void getRollout(com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager.rollouts().getByResourceGroupWithResponse("myResourceGroup", "myRollout", null, Context.NONE); + } +} diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/RolloutsListSamples.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/RolloutsListSamples.java new file mode 100644 index 0000000000000..64e987c40bff6 --- /dev/null +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/RolloutsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.deploymentmanager.generated; + +import com.azure.core.util.Context; + +/** Samples for Rollouts List. */ +public final class RolloutsListSamples { + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/rollouts_list.json + */ + /** + * Sample code: List rollouts by resource group. + * + * @param manager Entry point to DeploymentManager. + */ + public static void listRolloutsByResourceGroup( + com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager.rollouts().listWithResponse("myResourceGroup", Context.NONE); + } +} diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/RolloutsRestartSamples.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/RolloutsRestartSamples.java new file mode 100644 index 0000000000000..0332fe51a5fdd --- /dev/null +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/RolloutsRestartSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.deploymentmanager.generated; + +import com.azure.core.util.Context; + +/** Samples for Rollouts Restart. */ +public final class RolloutsRestartSamples { + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/rollout_post_restart.json + */ + /** + * Sample code: Restart rollout. + * + * @param manager Entry point to DeploymentManager. + */ + public static void restartRollout(com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager.rollouts().restartWithResponse("myResourceGroup", "myRollout", true, Context.NONE); + } +} diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/ServiceTopologiesCreateOrUpdateSamples.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/ServiceTopologiesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..cb4351a0b32fa --- /dev/null +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/ServiceTopologiesCreateOrUpdateSamples.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.deploymentmanager.generated; + +import java.util.HashMap; +import java.util.Map; + +/** Samples for ServiceTopologies CreateOrUpdate. */ +public final class ServiceTopologiesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/servicetopology_createorupdate.json + */ + /** + * Sample code: Create a topology with Artifact Source. + * + * @param manager Entry point to DeploymentManager. + */ + public static void createATopologyWithArtifactSource( + com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager + .serviceTopologies() + .define("myTopology") + .withRegion("centralus") + .withExistingResourceGroup("myResourceGroup") + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/servicetopology_createorupdate_noartifactsource.json + */ + /** + * Sample code: Create a topology without Artifact Source. + * + * @param manager Entry point to DeploymentManager. + */ + public static void createATopologyWithoutArtifactSource( + com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager + .serviceTopologies() + .define("myTopology") + .withRegion("centralus") + .withExistingResourceGroup("myResourceGroup") + .withTags(mapOf()) + .create(); + } + + @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/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/ServiceTopologiesDeleteSamples.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/ServiceTopologiesDeleteSamples.java new file mode 100644 index 0000000000000..fcc97e1bbe128 --- /dev/null +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/ServiceTopologiesDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.deploymentmanager.generated; + +import com.azure.core.util.Context; + +/** Samples for ServiceTopologies Delete. */ +public final class ServiceTopologiesDeleteSamples { + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/servicetopology_delete.json + */ + /** + * Sample code: Delete topology. + * + * @param manager Entry point to DeploymentManager. + */ + public static void deleteTopology(com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager.serviceTopologies().deleteWithResponse("myResourceGroup", "myTopology", Context.NONE); + } +} diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/ServiceTopologiesGetByResourceGroupSamples.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/ServiceTopologiesGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..f978fd7f0a02c --- /dev/null +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/ServiceTopologiesGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.deploymentmanager.generated; + +import com.azure.core.util.Context; + +/** Samples for ServiceTopologies GetByResourceGroup. */ +public final class ServiceTopologiesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/servicetopology_get.json + */ + /** + * Sample code: Get topology. + * + * @param manager Entry point to DeploymentManager. + */ + public static void getTopology(com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager.serviceTopologies().getByResourceGroupWithResponse("myResourceGroup", "myTopology", Context.NONE); + } +} diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/ServiceTopologiesListSamples.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/ServiceTopologiesListSamples.java new file mode 100644 index 0000000000000..7073ecfe413f3 --- /dev/null +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/ServiceTopologiesListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.deploymentmanager.generated; + +import com.azure.core.util.Context; + +/** Samples for ServiceTopologies List. */ +public final class ServiceTopologiesListSamples { + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/servicetopologies_list.json + */ + /** + * Sample code: List topologies. + * + * @param manager Entry point to DeploymentManager. + */ + public static void listTopologies(com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager.serviceTopologies().listWithResponse("myResourceGroup", Context.NONE); + } +} diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/ServiceUnitsCreateOrUpdateSamples.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/ServiceUnitsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..2c47ea0ce9c40 --- /dev/null +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/ServiceUnitsCreateOrUpdateSamples.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.deploymentmanager.generated; + +import java.util.HashMap; +import java.util.Map; + +/** Samples for ServiceUnits CreateOrUpdate. */ +public final class ServiceUnitsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/serviceunit_createorupdate.json + */ + /** + * Sample code: Create service unit using relative paths into the artifact source. + * + * @param manager Entry point to DeploymentManager. + */ + public static void createServiceUnitUsingRelativePathsIntoTheArtifactSource( + com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager + .serviceUnits() + .define("myServiceUnit") + .withRegion("centralus") + .withExistingService("myResourceGroup", "myTopology", "myService") + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/serviceunit_createorupdate_noartifactsource.json + */ + /** + * Sample code: Create service unit using SAS URIs. + * + * @param manager Entry point to DeploymentManager. + */ + public static void createServiceUnitUsingSASURIs( + com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager + .serviceUnits() + .define("myServiceUnit") + .withRegion("centralus") + .withExistingService("myResourceGroup", "myTopology", "myService") + .withTags(mapOf()) + .create(); + } + + @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/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/ServiceUnitsDeleteSamples.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/ServiceUnitsDeleteSamples.java new file mode 100644 index 0000000000000..46b10afc86718 --- /dev/null +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/ServiceUnitsDeleteSamples.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.deploymentmanager.generated; + +import com.azure.core.util.Context; + +/** Samples for ServiceUnits Delete. */ +public final class ServiceUnitsDeleteSamples { + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/serviceunit_delete.json + */ + /** + * Sample code: Delete service unit. + * + * @param manager Entry point to DeploymentManager. + */ + public static void deleteServiceUnit(com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager + .serviceUnits() + .deleteWithResponse("myResourceGroup", "myTopology", "myService", "myServiceUnit", Context.NONE); + } +} diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/ServiceUnitsGetSamples.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/ServiceUnitsGetSamples.java new file mode 100644 index 0000000000000..1686dd84c3148 --- /dev/null +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/ServiceUnitsGetSamples.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.deploymentmanager.generated; + +import com.azure.core.util.Context; + +/** Samples for ServiceUnits Get. */ +public final class ServiceUnitsGetSamples { + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/serviceunit_get.json + */ + /** + * Sample code: Get service unit. + * + * @param manager Entry point to DeploymentManager. + */ + public static void getServiceUnit(com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager + .serviceUnits() + .getWithResponse("myResourceGroup", "myTopology", "myService", "myServiceUnit", Context.NONE); + } +} diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/ServiceUnitsListSamples.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/ServiceUnitsListSamples.java new file mode 100644 index 0000000000000..e6f5e5979b00a --- /dev/null +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/ServiceUnitsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.deploymentmanager.generated; + +import com.azure.core.util.Context; + +/** Samples for ServiceUnits List. */ +public final class ServiceUnitsListSamples { + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/serviceunits_list.json + */ + /** + * Sample code: List service units. + * + * @param manager Entry point to DeploymentManager. + */ + public static void listServiceUnits(com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager.serviceUnits().listWithResponse("myResourceGroup", "myTopology", "myService", Context.NONE); + } +} diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/ServicesCreateOrUpdateSamples.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/ServicesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..bd74fe11db769 --- /dev/null +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/ServicesCreateOrUpdateSamples.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.deploymentmanager.generated; + +import java.util.HashMap; +import java.util.Map; + +/** Samples for Services CreateOrUpdate. */ +public final class ServicesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/service_createorupdate.json + */ + /** + * Sample code: Create service. + * + * @param manager Entry point to DeploymentManager. + */ + public static void createService(com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager + .services() + .define("myService") + .withRegion("centralus") + .withExistingServiceTopology("myResourceGroup", "myTopology") + .withTags(mapOf()) + .create(); + } + + @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/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/ServicesDeleteSamples.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/ServicesDeleteSamples.java new file mode 100644 index 0000000000000..c5a931b6e097e --- /dev/null +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/ServicesDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.deploymentmanager.generated; + +import com.azure.core.util.Context; + +/** Samples for Services Delete. */ +public final class ServicesDeleteSamples { + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/service_delete.json + */ + /** + * Sample code: Delete service. + * + * @param manager Entry point to DeploymentManager. + */ + public static void deleteService(com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager.services().deleteWithResponse("myResourceGroup", "myTopology", "myService", Context.NONE); + } +} diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/ServicesGetSamples.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/ServicesGetSamples.java new file mode 100644 index 0000000000000..face55c79d9eb --- /dev/null +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/ServicesGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.deploymentmanager.generated; + +import com.azure.core.util.Context; + +/** Samples for Services Get. */ +public final class ServicesGetSamples { + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/service_get.json + */ + /** + * Sample code: Get service. + * + * @param manager Entry point to DeploymentManager. + */ + public static void getService(com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager.services().getWithResponse("myResourceGroup", "myTopology", "myService", Context.NONE); + } +} diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/ServicesListSamples.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/ServicesListSamples.java new file mode 100644 index 0000000000000..4be18916f8097 --- /dev/null +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/ServicesListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.deploymentmanager.generated; + +import com.azure.core.util.Context; + +/** Samples for Services List. */ +public final class ServicesListSamples { + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/services_list.json + */ + /** + * Sample code: List services. + * + * @param manager Entry point to DeploymentManager. + */ + public static void listServices(com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager.services().listWithResponse("myResourceGroup", "myTopology", Context.NONE); + } +} diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/StepsCreateOrUpdateSamples.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/StepsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..7d5594bc31897 --- /dev/null +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/StepsCreateOrUpdateSamples.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.deploymentmanager.generated; + +import com.azure.resourcemanager.deploymentmanager.models.ApiKeyAuthentication; +import com.azure.resourcemanager.deploymentmanager.models.HealthCheckStepProperties; +import com.azure.resourcemanager.deploymentmanager.models.RestAuthLocation; +import com.azure.resourcemanager.deploymentmanager.models.RestHealthCheck; +import com.azure.resourcemanager.deploymentmanager.models.RestHealthCheckStepAttributes; +import com.azure.resourcemanager.deploymentmanager.models.RestMatchQuantifier; +import com.azure.resourcemanager.deploymentmanager.models.RestRequest; +import com.azure.resourcemanager.deploymentmanager.models.RestRequestMethod; +import com.azure.resourcemanager.deploymentmanager.models.RestResponse; +import com.azure.resourcemanager.deploymentmanager.models.RestResponseRegex; +import com.azure.resourcemanager.deploymentmanager.models.WaitStepAttributes; +import com.azure.resourcemanager.deploymentmanager.models.WaitStepProperties; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Steps CreateOrUpdate. */ +public final class StepsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/step_health_check_createorupdate.json + */ + /** + * Sample code: Create health check step. + * + * @param manager Entry point to DeploymentManager. + */ + public static void createHealthCheckStep(com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager + .steps() + .define("healthCheckStep") + .withRegion("centralus") + .withExistingResourceGroup("myResourceGroup") + .withProperties( + new HealthCheckStepProperties() + .withAttributes( + new RestHealthCheckStepAttributes() + .withWaitDuration("PT15M") + .withMaxElasticDuration("PT30M") + .withHealthyStateDuration("PT2H") + .withHealthChecks( + Arrays + .asList( + new RestHealthCheck() + .withName("appHealth") + .withRequest( + new RestRequest() + .withMethod(RestRequestMethod.GET) + .withUri( + "https://resthealth.healthservice.com/api/applications/contosoApp/healthStatus") + .withAuthentication( + new ApiKeyAuthentication() + .withName("Code") + .withIn(RestAuthLocation.QUERY) + .withValue( + "NBCapiMOBQyAAbCkeytoPadnvO0eGHmidwFz5rXpappznKp3Jt7LLg=="))) + .withResponse( + new RestResponse() + .withSuccessStatusCodes(Arrays.asList("OK")) + .withRegex( + new RestResponseRegex() + .withMatches( + Arrays + .asList( + "(?i)Contoso-App", + "(?i)\"health_status\":((.|\n" + + ")*)\"(green|yellow)\"", + "(?mi)^(\"application_host\": 94781052)$")) + .withMatchQuantifier(RestMatchQuantifier.ALL))), + new RestHealthCheck() + .withName("serviceHealth") + .withRequest( + new RestRequest() + .withMethod(RestRequestMethod.GET) + .withUri( + "https://resthealth.healthservice.com/api/services/contosoService/healthStatus") + .withAuthentication( + new ApiKeyAuthentication() + .withName("code") + .withIn(RestAuthLocation.HEADER) + .withValue( + "NBCapiMOBQyAAbCkeytoPadnvO0eGHmidwFz5rXpappznKp3Jt7LLg=="))) + .withResponse( + new RestResponse() + .withSuccessStatusCodes(Arrays.asList("OK")) + .withRegex( + new RestResponseRegex() + .withMatches( + Arrays + .asList( + "(?i)Contoso-Service-EndToEnd", + "(?i)\"health_status\":((.|\n)*)\"(green)\"")) + .withMatchQuantifier(RestMatchQuantifier.ALL))))))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/step_wait_createorupdate.json + */ + /** + * Sample code: Create wait step. + * + * @param manager Entry point to DeploymentManager. + */ + public static void createWaitStep(com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager + .steps() + .define("waitStep") + .withRegion("centralus") + .withExistingResourceGroup("myResourceGroup") + .withProperties(new WaitStepProperties().withAttributes(new WaitStepAttributes().withDuration("PT20M"))) + .withTags(mapOf()) + .create(); + } + + @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/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/StepsDeleteSamples.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/StepsDeleteSamples.java new file mode 100644 index 0000000000000..d693f99b103fa --- /dev/null +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/StepsDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.deploymentmanager.generated; + +import com.azure.core.util.Context; + +/** Samples for Steps Delete. */ +public final class StepsDeleteSamples { + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/step_delete.json + */ + /** + * Sample code: Delete deployment step. + * + * @param manager Entry point to DeploymentManager. + */ + public static void deleteDeploymentStep(com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager.steps().deleteWithResponse("myResourceGroup", "deploymentStep1", Context.NONE); + } +} diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/StepsGetByResourceGroupSamples.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/StepsGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..88e1b4cd39755 --- /dev/null +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/StepsGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.deploymentmanager.generated; + +import com.azure.core.util.Context; + +/** Samples for Steps GetByResourceGroup. */ +public final class StepsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/step_get.json + */ + /** + * Sample code: Get deployment step. + * + * @param manager Entry point to DeploymentManager. + */ + public static void getDeploymentStep(com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager.steps().getByResourceGroupWithResponse("myResourceGroup", "waitStep", Context.NONE); + } +} diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/StepsListSamples.java b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/StepsListSamples.java new file mode 100644 index 0000000000000..ec11b78887ced --- /dev/null +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/src/samples/java/com/azure/resourcemanager/deploymentmanager/generated/StepsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.deploymentmanager.generated; + +import com.azure.core.util.Context; + +/** Samples for Steps List. */ +public final class StepsListSamples { + /* + * x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/steps_list.json + */ + /** + * Sample code: List steps. + * + * @param manager Entry point to DeploymentManager. + */ + public static void listSteps(com.azure.resourcemanager.deploymentmanager.DeploymentManager manager) { + manager.steps().listWithResponse("myResourceGroup", Context.NONE); + } +}